Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 valid itemscope

Tags:

html

schema

I am marking up my content with schema.org microformats and am wondering about the itemscope attribute. The example given on http://schema.org/docs/gs.html is

<div itemscope itemtype="http://schema.org/Movie">

Is this valid HTML5? I thought attributes needed values, something like

<div itemscope="itemscope" itemtype="http://schema.org/Movie">
like image 518
Tom Kincaid Avatar asked Dec 20 '25 05:12

Tom Kincaid


2 Answers

It's a boolean attribute, which is valid HTML5.

If the attribute is present, its value must either be the empty string or a value that is an ASCII case-insensitive match for the attribute's canonical name, with no leading or trailing whitespace.

like image 158
zzzzBov Avatar answered Dec 22 '25 20:12

zzzzBov


If you want to produce valid XHTML5 (as opposed to HTML5 per se, which does not need to be well-formed XML), then @itemscope will need a value. Per the specs for boolean attributes linked by zzzzBov, to be valid XHTML 5 it will need to be one or the other of empty string or the attribute name, i.e. either <div itemscope=""> or <div itemscope="itemscope">

like image 39
DavidSewell Avatar answered Dec 22 '25 19:12

DavidSewell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!