20i Reseller Hosting

Help Please...

Discussion in 'Website Design' started by jim1, Nov 16, 2014.

Thread Status:
Not open for further replies.
  1. jim1 United Kingdom

    jim1 Member

    Joined:
    Nov 2010
    Posts:
    37
    Likes Received:
    0
    I am hoping someone can answer the below question please...

    When adding a underline to text in a static html web page should it be

    A) added to the page with <u></u> TAG.

    B) added to the style sheet in css as .underline {text-decoration: underline;} and then add <span class="underline"> </span> to the web page.

    I know they will both do the same thing but just want to know what is the best opition please.
     
  2. Domain Forum

    Acorn Domains Elite Member

    Joined:
    1999
    Messages:
    Many
    Likes Received:
    Lots
    articles.co.uk
     
  3. Jamie101 Netherlands

    Jamie101 Well-Known Member

    Joined:
    Jan 2012
    Posts:
    1,073
    Likes Received:
    16
    Go with A. I'd only tell you to use option B if you were doing something a bit more unique to it. Eg: different colour, font size or whatever.

    In general, less code is better.

    Sent from my GT-I9300 using Tapatalk 2
     
    Last edited: Nov 16, 2014
  4. jim1 United Kingdom

    jim1 Member

    Joined:
    Nov 2010
    Posts:
    37
    Likes Received:
    0
    Hi Jamie,

    Thank you for your reply, I did a google search for the answer and one web page said the underline tag has been deprecated / phased out.

    Please see http://meyerweb.com/eric/articles/webrev/199806.html

    Its all over my head so just wanted to be sure.

    Any thoughts?

    Cheers
     
  5. Aegean

    Aegean Active Member

    Joined:
    Feb 2011
    Posts:
    751
    Likes Received:
    16
    This is an either/or issue. I'd agree with Jamie & say go with A, simply because its such a small tag, like a bold tag. Its browser standard so there won't be a problem reading it.

    If you wish you can have all your text decor in your style sheet, but you'll only have to put larger tags in to reference it. I don't think its worth it for the sake of <u>a couple of keystrokes</u>
     
  6. Jamie101 Netherlands

    Jamie101 Well-Known Member

    Joined:
    Jan 2012
    Posts:
    1,073
    Likes Received:
    16
    It may be deprecated but I'd still have no problem using it over the span tags. Main reason is that it looks cleaner and let's face it, browsers are still going to use these types of tags for a long time to come.

    Sent from my GT-I9300 using Tapatalk 2
     
  7. martin-s United Kingdom

    martin-s Well-Known Member

    Joined:
    Jul 2012
    Posts:
    3,317
    Likes Received:
    224
    Personally for bold I'd use <strong>
     
  8. tifosi United Kingdom

    tifosi Well-Known Member

    Joined:
    Oct 2004
    Posts:
    3,401
    Likes Received:
    54
    The u tag isn't in html5. What to use depends on the doctype you're using in the html source.

    If the theme/template etc uses the <doctype> tag them use html5 which is via css with text-decoration: underline

    Really should be using html5 now.

    And for bold use either <strong> or alternatively for fine-tuning css with font-weight.

    It's not about less code, it's about the right code.
     
    Last edited: Nov 16, 2014
  9. seemly

    seemly Well-Known Member

    Joined:
    Feb 2011
    Posts:
    1,219
    Likes Received:
    184
    Last edited: Nov 16, 2014
  10. tifosi United Kingdom

    tifosi Well-Known Member

    Joined:
    Oct 2004
    Posts:
    3,401
    Likes Received:
    54
    Ok, true. HTML5 is a pretty dynamic thing and far from the finished article. Same with css3. In the end it's really browser support that matters, which mirrors as far as possible the current html5 & css3 recommendations.

    Still, as mentioned, I'd not use the <u> tag for underlining especially if using the html5 doctype.

    In a similar way the <i> tag is now deprecated as italics and is used in html5 for icons. The bootstrap css framework (and others) uses it extensively.
     
    Last edited: Nov 16, 2014
  11. seemly

    seemly Well-Known Member

    Joined:
    Feb 2011
    Posts:
    1,219
    Likes Received:
    184

    I just wanted to provide a correct point of reference, and that what HTML tags you use is totally dependent on the context, and as tifosi mentions, an element of reliance on the doctype declaration.
     
  12. tifosi United Kingdom

    tifosi Well-Known Member

    Joined:
    Oct 2004
    Posts:
    3,401
    Likes Received:
    54
    On the same page. :)

    As a side note Matt Cutts & others have made direct & indirect references to the fact that using html5 & modern semantic markup is a factor, albeit prob small, in their ranking algorithms.

    HTML5 should be a starting point for any new web page, and along with that semantic markup.

    S
     
Thread Status:
Not open for further replies.