Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML Question

Status
Not open for further replies.

dalesr003

Vendor
Apr 28, 2004
1
US
I am trying to double underline a word and cannot get the right command to do this. I know that a single underline is <U> <\U> but how do you do a double underline??

Please help...

Karen
 
There is no "double underline" tag in HTML. However, you can create the same effect using CSS.

I got this one from A List Apart. It works well. It uses CSS to create a double underline using the "border" property:

Code:
<html>
<head>
<title>Untitled</title>
<style type="text/css">
<!--
[blue]u {border-bottom: 0.075em solid; line-height: 107.5%}[/blue]
-->
</style>

</head>
<body>
<u>This is a test</u>
</body>
</html>
Note that all tags are lowercase. I noticed in your question that you used uppercase. You should get into the habit of using lowercase tags to be XHTML compliant.

Good luck,
Ron

We all play from the same deck of cards, it's how we play the hand we are dealt which makes us who we are. -Me

murof siht edisni kcuts m'I - PLEH
 
there isn't a double underline in html. you can make it look like one though using CSS.

Code:
<style>
.du {
    border-bottom:0.3em double red;
}
</style>


<span class="du">Double red underline</span>

will give a similar effect




Chris.

Indifference will be the downfall of mankind, but who cares?
 
twice today now! I really need to type quicker! [smile]



Chris.

Indifference will be the downfall of mankind, but who cares?
 
[bigsmile]

“If you are irritated by every rub, how will you be polished?”

~ Mevlana Rumi

murof siht edisni kcuts m'I - PLEH
 
I'm not getting either of these to work in IE 5.
This is a test (has single underline)
Double red underline (has no underline)

Code:
<html>
<head>
<title>Untitled</title>

<style type="text/css">
<!--
u {border-bottom: 0.075em solid; line-height: 107.5%}
.du {border-bottom:0.3em double red;}
-->
</style>

</head>
<body>
<u>This is a test</u>
<br>
<span class="du">Double red underline</span>
</body>
</html>
 
Code:
if ($YourBrowser == "IE5"}
   echo "Please upgrade to a better browser"
IE 5 is notorious for not being compatible with the standards. Both examples above work in IE6, Mozilla 1.6, Opera 7, & FireFox .8. Market share for IE5 is low and continuing to decline.

<myopinion>I wouldn't worry too much about coding for that audience. Code for Mozilla & IE6.</myopinion>

Ron

“If you are irritated by every rub, how will you be polished?”

~ Mevlana Rumi


murof siht edisni kcuts m'I - PLEH
 
oops, forgot to close line 2 with a semi-colon. Syntax error! [glasses]

“If you are irritated by every rub, how will you be polished?”

~ Mevlana Rumi


murof siht edisni kcuts m'I - PLEH
 
Darkshadeau,

I agree with the upgrade statement (except I'm still trying to figure out if "echo" is a javascript command :) ).

Here at work, we are back in the dark ages (can you believe NN 4.7 also ?). At home I'm current.

Thanks for the statistics link too.

Dave.
 
Wow. Someone should tell your IT manager that they need to upgrade. The longer they wait to upgrade, the worse things will get for their employees.

Oh, and I suppose I should have included
Code:
<?php

?>
in my post.

“If you are irritated by every rub, how will you be polished?”

~ Mevlana Rumi


murof siht edisni kcuts m'I - PLEH
 
Darkshadeau said:
Note that all tags are lowercase. I noticed in your question that you used uppercase. You should get into the habit of using lowercase tags to be XHTML compliant.
This is a good advice, but your code was hardly XHTML compliant. There is no <u> element in XHTML :)
 
There is no <u> element in XHTML :)
Depends which flavour of XHTML you're talking about, the <u> element is valid (though deprecated) in XHTML 1.0 Transitional.

Be warned, by the way, that using the bottom border property to underline text may not work correctly on all browsers when the underlined text wraps from one line to the next.

-- Chris Hunt
 
Vragabond said:
This is a good advice, but your code was hardly XHTML compliant. There is no <u> element in XHTML :)
[blush]

Gee, don't I feel sheepish. Uh, I mean, yes, what Chris Hunt said. That's what I mean. It depends on which version of XHTML you're using. Yeah, sure, I'm using XHTML 1.0. [upsidedown]

ChrisHunt said:
Be warned, by the way, that using the bottom border property to underline text may not work correctly on all browsers when the underlined text wraps from one line to the next.
I tested both examples in the current version of four major browsers. All lines wrapped as expected. Must be an older browser issue.

Thanks for the heads-up though.

Ron

“If you are irritated by every rub, how will you be polished?”

~ Mevlana Rumi


murof siht edisni kcuts m'I - PLEH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top