Display Contents

Ahmad Shadeed on CSS display: contents; — a feature that makes the DOM pretend that element just isn’t there (but it’s children are). Anything you use it for requires specific accessibility testing, but it can be quite useful. There are lots of use-cases here many of which boil down to “sometimes I want all these elements to be siblings, and sometimes I want wrappers around some of them”. I like Jeremy’s idea that HTML web component wrappers use this to remove themselves from equation, if the only purpose of that web component is augmenting the content already within it.

Learn to Work with Web Components

Leave a Reply

Your email address will not be published. Required fields are marked *

Did you know?

Frontend Masters Donates to open source projects. $313,806 contributed to date.