Saturday, June 22, 2024

Using the CSS “any” Selector, Developers Go Simple

While the new tags introduced by HTML5 are very useful for enabling the use of new features, including tags for sections, articles, asides, headers and footers, they can also make a developer’s work more difficult to style using CSS. By using the CSS “any” selector, a developer’s life can once again be easier. 

The -any() pseudo selector, which was proposed by Mozilla, makes life easier and makes CSS code much easier to read. It groups all of your top level tags together, and moves on to do the same with the next level of tags, and then moves on to H1 tags. 

The only limitation to using the any selector is that currently it is only supported by Firefox 4 and WebKit-based browsers. Hopefully it’s only a temporary limitation, as it was only introduced a year ago, and three browsers already support it. 

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Popular Articles

Featured