In replacement of deprecated <u>

liunx

Guest
I don't often underline things online, but I'm working on a webpage where I do need to underline a few things. In the past month, I've made the move from HTML Transitional to XHTML Strict (which I much prefer). While validating my code, I just realized that <u> </u> has been deprecated. Is there a similar, valid tag to use in it's place (Like <em> and <i> have the same affect) or do I need to replace it all the time with <span style="text-decoration:underline;">. Tis a bit of a pain, you know? Even if I were to use <span class="underline">, it would be a bit annoying. Of course, I guess the point is to remove presentational markup from the html and use css for that, but then why still use <i> and <b>?<!--content-->If you haven't used the EM tag anywhere in your page then you can define the default EM property in a style sheet. EM tag is valid unlike I, B and U.<br />
<br />
em{text-decoration:underline}<br />
<br />
It is recommended that you don't underline text as a lot of peole confuse it for hyperlinks.<!--content-->Well, certain text needs to be underlined because it is written works by others, and I like to follow the rules of proper written grammar :D . Anywho, I don't like to define the presentation elements of em, since the tag already comes with one. But oddly enough, because I tested this out, the <b> and <i> tags DO validate with XHTML 1.0 Strict, though I prefer to use <strong> and <em> respectively. I just found this odd, though.<!--content-->Originally posted by MstrBob <br />
...and I like to follow the rules of proper written grammar :D Bless you, my son. Sadly, there are few of us remaining... :(<!--content-->Originally posted by MstrBob <br />
Well, certain text needs to be underlined because it is written works by others, and I like to follow the rules of proper written grammar :DThen perhaps you should try the <q> tag, and if there are a lot of words written by others, use the <blockquote> element.<!--content-->No, erm, sorry If I didn't properly explain. But you know how when you quote a written work, one should underline the work's title?<br />
<br />
"Bob is really cool," by Mister Bob, An Auto-Bob-ography <br />
<br />
You see? But, I want to know why <u> is invalid, but <b> and <i> are okay?<!--content-->Maybe you shouldn't be asking, "why isn't <u> valid?" Maybe you should be asking, "why are <i> and <b> valid?"<br />
<br />
As far as I'm concerned they should all be invalid, they don't provide any information about the content inside them, <em> and <strong> do provide this information.<!--content-->Originally posted by MstrBob <br />
Of course, I guess the point is to remove presentational markup from the html and use css for that, but then why still use <i> and <b>? <br />
<br />
:p Just to be a pain in the arse.<!--content-->Well that's just it, they serve no other purpore than presentation. Emphasis and strong aren't just presentational.<br />
<br />
So have you had to settle for style="text-decoration:underline" or have you found another solution?<!--content-->there's nothing wrong with using em, or strong, to underline text. since thats exactly what you are doing, emphasizing it, making it stronger...<br />
<br />
<br />
please correct me if im wrong :)<!--content-->Ok, hate to do this... but you're wrong. :p<br />
<br />
<em> and <strong> are both semantic elements. <em> is to denote emphasis, while <strong> is to denote strong emphasis. Setting text-decoration: underline to every <em> element and then using it like one would have used the <u>, to simply underline text, is totally wrong semantically.<br />
<br />
As lavalamp suggested, setting text-decoration: underline on a span element is probably the best bet.<!--content-->This is why I sometimes wish it was valid to simply code XML style, and style that with CSS, and still be valid, cross browser, etc., i.e.: <br />
<br />
quote {margin: 0 10%; font-style: italic;}<br />
src {font-style: normal; text-decoration: underline;}<br />
...<br />
<quote>Blah, blahbitty blah. <src>101 ways to say Blah</src></quote><br />
It'd make life a lot easier.<br />
<br />
Why not do <em class="src">Source</em> ? You'd be emphasizing where you got the text, and you'd want to show it's your source, so I believe that'd be semantically correct...<br />
<br />
Oh yes, and why is it blockquote? Shouldn't it be quote?<!--content-->many people agree that italicizing is an appropriate method for distinguishing book titles:<br />
<!-- m --><a class="postlink" href="http://webster.commnet.edu/grammar/italics.htm">http://webster.commnet.edu/grammar/italics.htm</a><!-- m --><br />
you just don't italicize when you hand write things because it's hard to distinguish the difference<!--content-->Sounds right. I like to use italics to emphasize things, but my writing is already slanted... so it ends up looking like I was falling off my chair writing.<br />
<br />
I think you could also change the font weight, or make the font size bigger, and both would be acceptable ways of reffering to the source. it just has to stand out. And using the <em> tag would help, because then screen readers (unsure) and CSS-noncompliant browsers would still be able to see the stressed out words.<!--content-->Eh. I prefer to underline things, so for now I use <span class="underline">Title</span> though I see your points. I just prefer it, anyhow. And in terms of links, on the webpage in question, I don't have my links underlined unless mouse hover. But thanks anywho.<!--content-->
 
Back
Top