Day 57 of 100DaysOfSpec, 4.2.5 The meta element, contd.

I am reading and taking notes on the HTML specifications for 100 days as part of #The100DayProject. Read the initial intent/backstory. I am a Microsoft employee but all opinions, comments, etc on this site are my own. I do not speak on behalf of my employer, and thus no comments should be taken as representative of Microsoft’s official opinion of the spec. Subsections not listed below were read without comment.

Currently reading in 4.2.6 The style element. UA = user agent = browsers and other applications that process HTML documents.

For embedding CSS—well, styles in general, CSS implementation is not actually required by the spec—directly into a document (as opposed to linking to stylesheets or stuffing styles in an element’s style attribute).

Attributes on the style element:

  • type: The default value is "text/css". An unknown value in type should be ignored by the UA as if it’s unsupported.
  • media: tells what types of media the styles apply to. Screen, all, print, etc. Default is all.
  • title: sets alternate style sheet sets. This attribute doesn’t inherit from ancestors.
  • You shouldn’t set charset on style.

The style element’s descendants and subresources get processed before style itself. I suppose that’s something like an @import rule. Note: time spent fetching “critical subresources” blocks page load.