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!

Css to make text links work different on same page?

Status
Not open for further replies.

phototaker

Technical User
Mar 6, 2001
126
US
I have been having a problem getting a nagivation bar with text links and a background color change to act different than other text links on the page. I know this must be really simple but it is giving me headaches. I want to make the nagivation bar and logo a template for the whole site. The link is I want the text links to change to red on mouseover in the body of the page. I would also like to assign different looks to more links on the page if possible. Another page where I would like to assign different text links to is Please advise and thanks in advance. richard [spin2]
 
You have assigned a global style sheet to affect all href's the same. You'll need to assign classes to other you want to act differently.

<style>
a.diffLink {set style}
a.diffLink:hover {set style}
</style>

<a href=&quot;3&quot; class=&quot;diffLink&quot;>This is different</a>

DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
DeZiner:
Thanks, I knew it was simple but somehow I got confussed, your help is greatly appreciated. I guess I can just add more link looks as I want now. Richard
[wavey] [wavey] [wavey] [wavey] [wavey] [wavey]
 
Well I thought I had this figured out but when I place this code on another page in a different site. It works different. I can get the rollover text to all turn red or black but not different in the navigation from the other test links. If you can spot the problem I would appreciate your direction. is the new page and is the one you helped me with before. Thanks Richard [flush2] [flush2]
 
Try a.mylink instead of a.difflink in your style. You have assigned your links to the class 'mylink', not 'difflink'.

Kevin
A+, Network+, MCP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top