Thank you for taking the time to go back and learn how to write HTML properly. For the sake of accessibility, I wish we could somehow force all professional web developers to do this. But the W3C tried strict XHTML, and that ship has sailed.
There are a few elements that seem redundant. The legend element represents a caption for a fieldset element, the caption element represents a caption for a table element, and the figcaption element represents a caption for a figure element. I don’t know why one element couldn’t do the job for all three, since the meaning could be derived from the parent element.
Now I’m curious, too. Is it an ambiguity thing? A historical thing? Does HTML have any elements that derive meaning from their parent?
Maybe that’s how the designers of HTML thought about it? But that property is displayed by changing how the items appear (numbers vs bullets). When I’m reading a web page or editing a Google doc, it feels like the individual items are either bullets or numbered steps.
summary is also caption for details. all captions are equivalent to an h1 ina section around the item. img/picture/video/iframe vs object redunancy, etc
But for legend and caption, there was one perhaps-subtle difference in HTML 4: legend, as a form element, supported the accesskey attribute, while caption did not. Different attribute lists, different elements.
As of HTML5 I believe they also have different permitted content, but in HTML 4 they both allowed any %inline content.
Thank you for taking the time to go back and learn how to write HTML properly. For the sake of accessibility, I wish we could somehow force all professional web developers to do this. But the W3C tried strict XHTML, and that ship has sailed.
Now I’m curious, too. Is it an ambiguity thing? A historical thing? Does HTML have any elements that derive meaning from their parent?
<li>
changes when it’s in a<ul>
vs<ol>
. At least to me, “list-item that has order” and “list-item that lacks order” seem like different meanings.Oh duh yeah that’s a perfect example I didn’t think of
Isn’t order the property of the container?
Maybe that’s how the designers of HTML thought about it? But that property is displayed by changing how the items appear (numbers vs bullets). When I’m reading a web page or editing a Google doc, it feels like the individual items are either bullets or numbered steps.
How things are displayed is a matter of style, and the style cascades through all children elements.
For example to style an ordered list so it uses roman numerals, you add
list-style:upper-roman
to the<ol>
, not to each<li>
.summary is also caption for details. all captions are equivalent to an h1 ina section around the item. img/picture/video/iframe vs object redunancy, etc
Unsure about
figcaption
.But for
legend
andcaption
, there was one perhaps-subtle difference in HTML 4:legend
, as a form element, supported theaccesskey
attribute, whilecaption
did not. Different attribute lists, different elements.As of HTML5 I believe they also have different permitted content, but in HTML 4 they both allowed any
%inline
content.