I wish HTML could do something semantically equivalent to this;
<dl class="main-list">
<definitionitem>
<dt>Some Thing</dt>
<dd>You know it!</dd>
<dt>Another Thing</dt>
<dd>Word.</dd>
</definitionitem>
<definitionitem>
<dt>Stuff</dt>
<dd>Alright!</dd>
</definitionitem>
</dl>
However, since the closest I’ve come is something I’m not 100% satisfied with the semantics of;
<div class="redundant-wrapper">
<dl class="main-list">
<dt>Some Thing</dt>
<dd>You know it!</dd>
<dt>Another Thing</dt>
<dd>Word.</dd>
</dl>
<dl class="another-main-list">
<dt>Stuff!</dt>
<dd>Alright!</dd>
</dl>
</div>
I was wondering if anyone has any other ideas of how you might do this?
Also, the reason the items would be grouped is because they are visually grouped in the content that is being marked up. Imagine a dictionary page, with a single definition list, where each definition is in an inset box that is floated left. I run into this situation all the time.
No, Ian Hickson (HTML spec editor) is convinced that this is a CSS problem, not an HTML one:
At the same time, fantasai (CSS spec editor) is convinced in contrary:
Nevertheless, Ian apparently ignores that and continues to be detached from reality.
There are same problems with
LEGEND(that must be first direct child ofFIELDSETaccording to HTML spec),FIGCAPTION(that must be first/last direct child ofFIGURE), andLI(direct child ofUL/OL).As for
DT/DDin particular, I personally useULlist withDLinside each ofLI:So we have
DLto make relation betweenDTandDD, andULlist to make them all belong to one list.Update (2016-11-14): The HTML standard (WHATWG version for now) now (since 2016-10-31) allows the
DIVelement (optionally intermixed with so-called script-supporting elementsSCRIPT,TEMPLATE) to be direct children ofDLelements. W3C’s HTML validator does not account for this change yet, but the experimental HTML5.org validator does.Update (2017-01-18): Turns out the spec does not allow more than one nested
DIVwrapper forDT/DD, so usefulness of the feature in practice is actually very limited and theUL→LI→DLapproach described here is still relevant.