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!

CSS Help - How to Lower the Underline

Status
Not open for further replies.

mickeyj2

Programmer
Jun 7, 2007
79
US
Hi,

I have the following CSS style

.SuperText {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 8px;
color: #000000;
font-weight: normal;
position:relative; top:-4px;
text-decoration: none;

}

What this does is take text and superscript it - for example "TM" as in Trademark and the (R) in Registration.

Here's the problem. Suppose I do the following:

<a href=" XP <span class=supertext>TM</span></a>, then the underline that's normally done in my <a href> will be broken because I have a text-decoration: none in my supertext class.

I've also tried keeping the text-decoration as underline and not having it at all, but then my "TM" is underlined directly underneath, and is not consistent with the underlining for the rest of the link, which looks weird.

What can I do?

Any help is appreciated.

Thanks,
mickeyj2
 
Super- and sub- script should be: <sup></sup> and <sub></sub> respectively to be semantically correct.

I don't think spans aren't allowed in a tags (I don't think), and using spans for style is just as bad as using font tags, IMHO.

styling it should be thus:
Code:
sup
{
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 8px;
    color: #000000;
    font-weight: normal;
    /*removed position as this is done for you*/
    text-decoration: none; 
}

sub
{
}

(R) and TM, btw, are &reg; and &trade; respectively.

[plug=shameless]
[/plug]
 
Hi jstreich,

Thanks for the response. I think I'm going to go ahead and use &trade; . This seems to work for me.

I knew about &reg;, but not &trade;. I guess its because I'm still using Homesite and they offer a different one.

Thanks again.
mickeyj2
 
I don't think spans aren't allowed in a tags (I don't think), and using spans for style is just as bad as using font tags, IMHO.

Just to correct that - spans are allowed in tags, and using spans for styling is no problem at all as long as it is done responsibly (i.e. you're not using spans where you should be using something more appropriate).

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top