-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Reconsider FAQ: <di>, <div> or <li> wrapping <dt> and <dd> #1937
Description
This is a styling problem and should be fixed in CSS. There's no reason to add a grouping element to HTML, as the semantics are already unambiguous.
There will be no CSS pseudo-element ::wrap
in the forseeable future, see w3c/csswg-drafts#588. I believe it’s therefore worth to reevaluate the use cases and review the FAQ entry.
Current state
The parsing rules for dl
are quite clear, but even if browsers implemented them perfectly, there’d still be no way to take advantage of the structure in CSS.
<dl>
<dt>term <dt>alias <dd>definition
<dt>term <dd>definition <dd>alternate definition
<dt>term <dt>alias <dd>definition <dd>alternate definition
</dl>
di
Wrapper
This has also been called dli
. It has all the problems of any new element type, and some more.
<dl>
<di><dt>term <dt>alias <dd>definition</di>
<di><dt>term <dd>definition <dd>alternate definition</di>
<di><dt>term <dt>alias <dd>definition <dd>alternate definition</di>
</dl>
li
Wrapper
It has all the problems of using existing elements in places where they were not supposed to occur previously, which can be quite unexpected.
<dl>
<li><dt>term <dt>alias <dd>definition</li>
<li><dt>term <dd>definition <dd>alternate definition</li>
<li><dt>term <dt>alias <dd>definition <dd>alternate definition</li>
</dl>
dt
/dd
in li
It may be worth exploring whether ditching dl
has better backwards compatibility than changing it.
<ul>
<li><dt>term <dt>alias <dd>definition</li>
<li><dt>term <dd>definition <dd>alternate definition</li>
<li><dt>term <dt>alias <dd>definition <dd>alternate definition</li>
</ul>
Generic list
element
<list>
<lh>header
<dt>term <dd>definition
<di><dt>term <dt>alias <dd>definition</di>
<di><dt>term <dd>definition <dd>alternate definition</di>
<di><dt>term <dt>alias <dd>definition <dd>alternate definition</di>
<li>item
</list>
Activity