I\'ve been writing HTML since the 90s, but I just found out about the colgroup
and col
elements. According to MDN, col
is a void e
What you are citing as “W3 spec” is a non-authoritative reference. The W3C Recommendation HTML 4.01 refers to empty elements as elements with EMPTY
declared content, i.e. elements that cannot have any content. It does not use the phrase “void element” at all.
HTML5 drafts specify the elements that are emppty elements in HTML 4.01 as having “empty” content model but do not actually define such a model. Instead, it mentions void elements and says that they “can't have any contents”.
So the confusion is in the HTML5 drafts. Independently of this, it is important to distinguish between empty/void elements that cannot (by the specs and by the parsing rules actually applied) ever have any content and elements that just happen to have empty content, such as empty elements (bad practice) and empty
elements (usually bad practice, but valid and sometimes adequate).