SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: underlining

  1. #1
    SitePoint Member
    Join Date
    Jul 2013
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    underlining

    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
    Location
    Yorkshire, UK
    Posts
    5,888
    Mentioned
    122 Post(s)
    Tagged
    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
    Location
    Argyll, Scotland
    Posts
    6,146
    Mentioned
    261 Post(s)
    Tagged
    5 Thread(s)
    http://www.html-5.com/changes/deprec...tyle-tags.html

    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.

  4. #4
    Non-Member
    Join Date
    May 2014
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HTML Code:
    <head>
    <style>
    *{text-decoration:underline;}
    </style>
    use this style code to the text where you want underlining.

  5. #5
    SitePoint Zealot
    Join Date
    Aug 2006
    Location
    Sydney, Australia
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Veeramanikandan View Post
    HTML Code:
    <head>
    <style>
    *{text-decoration:underline;}
    </style>
    use this style code to the text where you want underlining.
    Wouldn't that just replicate the same problem Stevie pointed out above, i.e underline for most people means a link?
    www.scaryminds.com ScaryMinds - horror's last colonial outpost.

  6. #6
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,796
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    Wouldn't that just replicate the same problem Stevie pointed out above, i.e underline for most people means a link?
    Yes. Basically it means you can underline text via the U tag or via CSS, but you must consider the general convention that underline text is a link. But sometimes un-underlined text is a link. for example HEADLINES. Through good graphic design, and patient users, you could , however make links visible using some sort of uniform color scheme and underline on hover ( to reinforce that the hovered text is a link).

    be adviced you would be fighting against the usual and natural flow of user's navigation instincts.


Bookmarks

Posting Permissions

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