W3C home > Mailing lists > Public > www-style@w3.org > December 2009

Request for ::di pseudoelement

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 18 Dec 2009 17:18:39 -0600
Message-ID: <dd0fbad0912181518v1e2d879j1e3761763accc31a@mail.gmail.com>
To: www-style list <www-style@w3.org>
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

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.

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

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:41 UTC