开发者

Link with time tag

开发者 https://www.devze.com 2023-02-20 16:22 出处:网络
What would be the correct? <a> <time>TIME_HERE</time> </a> 开发者_JAVA技巧 or

What would be the correct?

<a>
  <time>TIME_HERE</time>
</a>
开发者_JAVA技巧

or

<time>
  <a>TIME_HERE</a>
</time>

Or maybe none of the above are valid.


The specification indicates that without a datetime attribute the content should be a valid date or time string, thus the anchor should wrap the time element rather than the reverse. If a datetime attribute is present, the contents need not specify a date or time and you could conceivably have an anchor tag inside. Note that none of the examples in the specification have descendent elements (other than text nodes) inside a time element.

http://www.w3.org/TR/html5/text-level-semantics.html#the-time-element

0

精彩评论

暂无评论...
验证码 换一张
取 消