Skip to main content

Day 39 of 100DaysOfSpec, 3.2.4 Content Models, 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 3.2.4 Content Models. Palpable content

Elements with a content model that allows flow or phrasing content should contain at least one "node" of palpable content. Possibly how you've heard this manifest is "you shouldn't have an empty <p> tag". Likely the most common use case of people neglecting to include palpable content is when they add an empty container to a page, to be filled in with Javascript.

The spec "encourages" conformance checkers to flag an error/warning/notice when they find elements empty of palpable content.

Check out the spec for the full list of palpable content elements, which also includes non-inter-element-whitespace text. Some of these elements have conditions on them; for example, a <ul> counts as palpable content if it has at least one <li> child. Script-supporting elements

script, template. Transparent content models

Elements with a "transparent" content model inherit the content model of the parent, and have the same descendent requirements as this parent.

If a transparent element doesn't have a parent, its content model is treated as flow content.


My blog uses Webmentions. Responses from Mastodon and other sites that send Webmentions will show up here.

No Webmentions have been sent to this post yet.