[html5] microdata and the dl element
webmaster at tsmchughs.com
Sun May 20 01:35:17 PDT 2012
On 5/20/12 1:01 AM, Benjamin Hawkes-Lewis wrote:
> On Sun, May 20, 2012 at 5:35 AM, Brian Tremblay wrote:
>> I've marked up a restaurant menu using the <dl> element, with a <dt> for
>> each item, followed by 2 or more <dd> elements, one for price, description,
>> and, where appropriate, additional options.
>> I want to add microdata product markup (http://schema.org/Product) but can't
>> find a way to do it. It seems like I need a wrapper for each menu item
> No. You can use @itemref:
> <dt id=artichokes
> itemref="artichokes-offers artichokes-description">
> <span itemprop=name>Artichoke Hearts Au Gratin</span>
> <dd id=artichokes-offers
> <span itemprop=price>$6.50</span>
> <dd id=artichokes-description itemprop=description>
> Diced artichoke hearts baked in a cheddar-parmesan sauce.
> Served with our Irish soda bread and molasses wheat bread.
> <dt id=shrimp-cocktail
> itemref="shrimp-cocktail-offers shrimp-cocktail-description">
> <span itemprop=name>Peel& Eat Shrimp</span>
> <dd id=shrimp-cocktail-offers
> <span itemprop=price>$7.50</span>
> <dd id=shrimp-cocktail-description itemprop=description>
> A half pound of chilled shrimp with our cocktail sauce.
Yikes! That's a lot more markup than the original. And I'd have to
manage unique ids for each menu item, too. It's getting mighty
>> which I sort of think should be there anyways.
> The editor's take was that features should be added to CSS to support
> styling definition names and values as groups.
I'd agree. But my case does not involve styling. It involves trees and
subtrees and scoping. Without a <dli> there's no clear item parent for
any <dt> or <dd> element.
More information about the Help