HTML5: embedding CSS styles with the scoped attribute of the style element

Embedding CSS styles into the HTML elements of a web document is allowed by the HTML5 specifications, provided that you use the scoped attribute of the style element. This feature has interesting implementations for some popular CMS frameworks (such as WordPress) where many widgets and plugins make a large use of this kind of embedded styles.

Just a word of caution: if you're developing a widget or a plugin, you can't know in advance which kind of DTD will be used. This feature is valid in HTML5 only, so be cautious.

Back to top