[html5] the case for a <dli> element

Brian Tremblay webmaster at tsmchughs.com
Sun Dec 30 08:55:36 PST 2012


I'm using <dl> markup for a restaurant menu, and have added product 
microdata markup from schema.org. Because items in a <dl> are defined 
implicitly -- <dt> element(s) followed by <dd> element(s) --  there's no 
easy way to scope them individually. What I'm left doing is adding 2 id 
attributes for each menu item, and using itemref:

http://tsmchughs.com/test/dessert

If we had a <dli> element, to scope each item in a description list, the 
markup needed to add microdata (or microformats) would be much simpler. 
Here's an example:

http://tsmchughs.com/test/dessert-test

Note that these are test examples derived from a real world example. 
Here's the dessert menu for the restaurant:

http://tsmchughs.com/menus/dessert

Because the list is short, I've added the necessary id and itemref 
attributes. But I have not for longer menus, e.g.:

http://tsmchughs.com/menus/lunch
http://tsmchughs.com/menus/dinner

The authoring costs -- maintaining 2 unique ids for each menu item -- 
are too high for anything more than a few items. Using <table> markup 
for a menu is much easier:

http://www.tenmercer.com/menu/dinner

Therefore, I think we need a <dli> element. This has come up in the 
past. If I understand correctly, the editor has declined, saying that 
the need for <dli> is only to make styling easier, so the problem should 
be solved in css. But I think the problem here is not styling, it's 
creating natural, discrete items in a description list, which might be 
used for styling, or for microdata, or perhaps for other reasons which I 
haven't thought of. Without <dli>, use of <dl> becomes much harder to 
use even though it may be the best markup choice.

-- 
Brian Tremblay



More information about the Help mailing list