Semantic-html, article-and-section

In the lesson on HTML semantics, we’re introduced to the , and tags amongst others.
Rather than using tags, can’t one use the

tag instead?
Secondly, rather than making the tag a child of the tag, wouldn’t it be preferable to use the

tag as the child?

Being as there are no hard and fast rules in HTML, and given that it all hinges around a set of recommendations and guidelines, the only thing that one can deem ‘preferable’ is well-formedness and validation, as well as meeting with the third level of WAI-WCAG and any that are recommended by WHATWG.

We should also note that there is a difference between a ‘tag’ and an ‘element’.

<p>  =>  OPENTAG
</p> =>  ENDTAG

<p>...</p>  =>  element

The very worst thing one can do when learning HTML is to see it as governed by rules, which as stated above, it is not. In other words, don’t start narrowing your options with imaginary or arbitrary rules or preferences. Keep an open mind and think, ‘structure’ and ‘outline’.

The choice of elements used is based upon what we want the structure to tell a reader of the markup. Semantic elements are intended to assist in that process with a little more clarity, not to be confused with specificity.

Thanks immensely. Versatility is like a virtue to HTML. Your contributions in other topics too are quite enlightening, please do not relent. Take care

1 Like