SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: underlining

  1. #1
    SitePoint Member
    Join Date
    Jul 2013
    0 Post(s)
    0 Thread(s)


    I can't find in the book or web sites for the correct html markup for underlining text; from my understanding, <u> and </u> is obsolete.

  2. #2
    Mouse catcher silver trophy
    Stevie D's Avatar
    Join Date
    Mar 2006
    Yorkshire, UK
    110 Post(s)
    1 Thread(s)
    Quote Originally Posted by Linda Walker View Post
    I can't find in the book or web sites for the correct html markup for underlining text; from my understanding, <u> and </u> is obsolete.
    There's a bit of mythology around the <u> tag. Like <b> and <i>, it has not been officially deprecated, because there are times when you want text to be underlined and that is the most semantically appropriate tag to use. However, whereas <strong> typically gives bold text and <em> typically gives italic text, and these carry more semantic meaning than <b> and <i>, there is no real equivalent for <u>.

    And why is that? Because it's recommended that in general, you avoid underlining text on the web ... because underlined text looks like a link. Go on, hands up, how many of you were thinking about clicking on that? The convention that underlined text signifies a link is completely hard-wired into surfers, so if you have underlined text that isn't a link, it's going to be confusing for them and will make it harder for them to tell what is clickable and what isn't.

    Sure, there will be times when underlining is what you need, such as when you are working to a particular legal or house style guide, or making a facsimile replica of a printed document, and in those cases it's fine to use <u> if there's no other handy semantic element to hang text-decoration:underline; on ... but apart from that very small set of examples, you shouldn't be underlining anything except links, and with links there's no need to use <u>!

  3. #3
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Argyll, Scotland
    213 Post(s)
    5 Thread(s)

    u (underlined text) was deprecated in HTML version 4 but added back in HTML 5 for special circumstances, such as to underline proper names in Chinese

    To avoid confusion with hypertext links, one of the alternatives to the <u> tag should be used instead; if the underline is required, the style="text-decoration: underline" CSS style should be used instead.
    Don't be arrogant. Be kind to a koala that thinks it's a bear.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts