5

What would be the correct?

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

or

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

Or maybe none of the above are valid.

1 Answer 1

7

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.