-1

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

Nick
  • 3
  • 3
  • I'm not exactly sure what you're asking, but this might be informative: [Return of the U element](http://html5doctor.com/u-element/). – showdev May 04 '15 at 18:46
  • Thank you very much for providing me that link! – Nick May 04 '15 at 18:53

4 Answers4

0

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;.

dersvenhesse
  • 5,805
  • 1
  • 24
  • 45
  • thank you for answering!! as i found out "Regardless of whether an element is deprecated (HTML 4, XHTML 1) or non-conforming (HTML5) or just plain uncool, browser makers still have to support it for backward compatibility with all those web pages". this kind of answered my quesion as well! – Nick May 04 '15 at 18:53
  • That's true. But you should avoid mixing various HTML standards. ;) – dersvenhesse May 04 '15 at 18:54
0

<u> has slipped back into HTML5 for a couple rare, non-conforming instances dealing with other languages and things like spell check. Essentially, to cover any instance when a user will expect an underline.

A helpful link on why <u> is back after being depreciated in HTML4 --> http://html5doctor.com/u-element/

SRing
  • 686
  • 6
  • 14
0

As found out, thank to you

"Regardless of whether an element is deprecated (HTML 4, XHTML 1) or non-conforming (HTML5) or just plain uncool, browser makers still have to support it for backward compatibility with all those web pages".

Thank you guys!

Nick
  • 3
  • 3
0

The <u> and </u>tags DO work just like <span style="text-decoration: underline;">......</span>They both underline all the text in their enclosed elements. However, having all those formatting tags in your HTML code can make the code very difficult to read. As dersvenhesse says, an alternative would be to use the text-decoration property and set it to underline.