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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Underline

Status
Not open for further replies.

arpan

Programmer
Oct 16, 2002
336
IN
Suppose I have the following HTML code which underlines a sentence:

<u>My name is <font color=red>Arpan</font></u>

What this does is the color of the underline for the words 'My name is ' will be black where as the color of the underline for the word 'Arpan' will be in red color since I have introduced <font color=red> just before the word 'Arpan'. Is there any way the entire underline could be made black (or red or for that matter, one uniform color)?

Thanks,

Arpan
 
I can't figure out a way of doing this. However using underline is a way to confuse people. Underlined text are usually links and people might expect to be able to click on the underlined word.

How about using bold instead to have the emphasis on this word? Gary Haran
 
Hi,

I don't think that's possible, but this is a way to do it:

<style type=&quot;text/css&quot;>
.black
{
border-bottom: medium solid #000000 1px;
}
.red
{
border-bottom: medium solid #ff0000 1px;
}
</style>

<font class=&quot;black&quot;>My name is </font><font class=&quot;red&quot;>Arpan</font>

H.T.H.

Quasibobo Don't eat yellow snow!
 
quasibobo, maybe you mean this :

<style type=&quot;text/css&quot;>
.black
{
border-bottom: medium solid #000000 1px;
}
.red
{
color: red ;
border-bottom: medium solid #000000 1px;
}
</style>

<span class=&quot;black&quot;>My name is </span><span class=&quot;red&quot;>Arpan</span>

Gary Haran
 
Hi Quasibobo,

Why do you think that's not possible? In fact, making a minor alteration of your code, I could do what I wanted i.e. the entire underline should be black even if 'Arpan' is in red color. This is what I did:

<style type=&quot;text/css&quot;>
.black{
border-bottom:medium solid #000000 1px;
}
</style>

<font class=&quot;black&quot;>My name is </font><font color=red class=&quot;black&quot;>Arpan</font>

You can even get rid of the class 'red'. Try it out!!!!!!!

Thanks for your help,

Regards,

Arpan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top