datetime - HTML5 empty <time> tag for date of publication -


i'm confused html5 <time> semantic tag. seems me it's tagging strings such "today", "last christmas", "10.10.2010", "2am" etc. machines recognize , understand them. valid examples find on html5 doctor , w3c page like:

<p>i have date on <time datetime="2008-02-14">valentines day</time>.</p>   <p>we open @ <time>10:00</time> every morning.</p> 



if want set article publication date (e.g. google robots), without string displaying it? valid have:

<article><time datetime="..."></time> content </article> 

or:

<article><time datetime="..." /> content </article> 

or should other way?

(it seems hilarious me have e.g. <time datetime="...">...</time> , css display:none time selector...)

the time element contains datetime value in machine-readable (the datetime attribute) , human-readable (the text content) formats.

the datetime value of time element value of element's datetime content attribute, if has one, or element's textcontent, if not.

whatwg

so if datetime attribute absent, datetime value parsed text content.

if datetime attribute present, free write text content, or nothing in case.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -