Enjoy unlimited access to all forum features for FREE! Optional upgrade available for extra perks.

Help Please...

Status
Not open for further replies.
Joined
Nov 24, 2010
Posts
37
Reaction score
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.
 
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:
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>
 
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
 
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:
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.

Note: The default rendering of the u element in visual presentations clashes with the conventional rendering of hyperlinks (underlining). Authors are encouraged to avoid using the u element where it could be confused for a hyperlink.

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


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

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
 
Status
Not open for further replies.

The Rule #1

Do not insult any other member. Be polite and do business. Thank you!

Featured Services

Sedo - it.com Premiums

IT.com

Premium Members

AucDom
UKBackorder
Be a Squirrel
Acorn Domains Merch
MariaBuy Marketplace

New Threads

Domain Forum Friends

Other domain-related communities we can recommend.

Our Mods' Businesses

Perfect
Service
Laskos
URL Shortener
*the exceptional businesses of our esteemed moderators
Top Bottom