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

Text Color and Stylesheet...

Status
Not open for further replies.

CharlieIT

MIS
Apr 9, 2003
157
US
I have a page which uses a stylesheet. The text at the top of the page is using "Maintop" and the text at the bottom of the page is using "MainBottom".

The Stylesheet looks like this:

.MainTop {
font-family: Verdana, Arial,;
font-size: 11 px;
font-weight: bold;
}
a:link, a:visited {
color:cyan
}

.MainBottom {
font-family: Verdana, Arial,;
font-size: xx-small;
font-weight: bold;
}
a:link, a:visited {
color: yellow
}

The Problem: All the text on the page is showing up yellow as specified in .MainBottom. If I delete the a:link line in .MainBottom, all the text shows up as cyan--as specified in .Maintop.

Does anyone know what I'm doing wrong?
 
Ja, You're not associating the different A selectors with their respective classes. What you are doing is creating two separate - not to mention global - definitions of how a link should look. The browser simply uses the last one it was told about for all links on your page.

Try:
[tt]
.MainTop {
font-family: Verdana, Arial,;
font-size: 11 px;
font-weight: bold;
}
.MainTop a:link, .MainTop a:visited {
color:cyan
}

.MainBottom {
font-family: Verdana, Arial,;
font-size: xx-small;
font-weight: bold;
}
.MainBottom a:link, .MainBottom a:visited {
color: yellow
}
[/tt]

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top