Search code examples
csshtmlcreation

HTML5 declaration about new and old tags


I'm sorry for how ridiculous this question might seem and for my english. I'm just stuck and can't understand this.

How can we still use the <u>....</u> in HTML5 and the result be the same with <span style="text-decoration: underline;">......</span> ? Didn't it stop to have support?

I mean how isn't <u>....</u> supported in HTML5 if i can still use it on full way?

Thank you, and once again sorry


Solution

  • The u is not invalid in HTML5. It just changed it's definition (see here):

    The u element represents a span of text with an unarticulated, though explicitly rendered, non-textual annotation, such as labeling the text as being a proper name in Chinese text (a Chinese proper name mark), or labeling the text as being misspelt.

    So it's not recommended to use u to underline text as you're pointing out correctly. A proper way is to use CSS and text-decoration: underline;.