Elements with a Transparent content model are defined as follows:
If an element has a transparent content model, then its contents must be structured such that they would be valid HTML 5, even if the transparent element were removed and replaced by the child elements.
Source: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#transparent_content_model
With this definition, and knowing the permitted content types of elements as defined by the spec, would it be safe to say that these elements can be classified as "Transparent content"?:
<a>, <article>, <aside>, <audio>, <b>, <blockquote>, <button>, <canvas>, <code>, <del>, <details>, <div>, <em>, <fieldset>, <figure>, <footer>, <form>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <header>, <i>, <ins>, <kbd>, <label>, <main>, <mark>, <meter>, <nav>, <p>, <picture>, <pre>, <progress>, <q>, <s>, <section>, <small>, <span>, <strong>, <sub>, <sup>, <textarea>, <u>, <video>
(Does a more authoritative list exist? I wasn't able to find one since search results for transparent content quickly become CSS-related.)
W3 Spec: https://www.w3.org/TR/2011/WD-html5-20110525/content-models.html#transparent-content-models
WHATWG Spec: https://html.spec.whatwg.org/dev/dom.html#transparent-content-models
Elements with a Transparent content model are defined as follows: ...
You're quoting MDN which is a reference but not an official specification. It's a secondary source, which means that it's useful for understanding technical details, but cannot be relied on to provide actual definitions.
W3C ceded authority over the HTML5 specification to WHATWG in 2019 so html.spec.whatwg.org is the canonical specification at the time of writing.
The specification includes the following for "Transparent content models"
Some elements are described as transparent; they have "transparent" in the description of their content model. The content model of a transparent element is derived from the content model of its parent element: the elements required in the part of the content model that is "transparent" are the same elements as required in the part of the content model of the parent of the transparent element in which the transparent element finds itself.
So with that your question of:
With [an incorrect] definition, and knowing the permitted content types of elements as defined by the spec, would it be safe to say that these elements can be classified as "Transparent content"?
No. The specification indicates each elements' content model in their respective "Content model:" heading in section 4 ("The elements of HTML").
While the specification does include convenient lists of the different types of content in "3.2.5.2 Kinds of Content", there unfortunately isn't a list of transparent content.
So to determine which elements have transparent content models, you have to search the list of all the HTML elements.
For your convenience, the elements that presently have transparent content models are as follows:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With