Request for ::di pseudoelement

Well, I find myself once again ripping out a <dl> and replacing it
with a <ul> with headers in the <li>s, because there's no grouping
element around <dt>s and <dd>s.  There's a perennial request for a
<di> element, but that's not really the correct place to solve the
problem - HTML has no need for any additional help in grouping the
dt/dd elements, as the grouping is well-defined in the spec.  This is
purely a styling issue, and a common one for me.

So, I propose a ::di pseudoelement.  It would wrap around groups of
<dt>/<dd>s, according to the grouping algorithm in HTML.  You'd use it
like:

dt::di { border: 1px solid black; margin: 1em 0; }

Multiple elements can refer to the same ::di if they're in the same group.

It's possible that this can have its definition generalized somewhat
so it makes sense outside of this specific use-case.
::key-value-group was suggested by zcorpan some time ago.  I don't
have any idea if this would be worth the extra typing, though - it
doesn't appear that there are any additional uses for this in HTML
itself, and I'm not familiar enough with other markup languages that
use CSS to tell if this would solve any problems for them.

~TJ

Received on Friday, 18 December 2009 23:20:11 UTC