Click to See Complete Forum and Search --> : Are there any other classes for links other than link, hover visited and active?


sneeu
09-18-2008, 11:39 AM
Hi All

Could someone please help me. I want a link on my website to change colour only when i m on that page. Kind of like an indicator of which page i am on.

So if I click 'about us' the about us text will be yellow. But if i go to 'contact us 'the about us yellow colour reverts to its original and now the contact us is yellow.


Cheers guys


Zane

opifex
09-18-2008, 02:36 PM
Pretty simple....
your menu ...i like using list items
<ul>
<li><a href="home.html" class="home">Home</a></li>
<li><a href="about.html" class="about">About us</a></li>
<li><a href="contact.html" class="contact">Contact us</a></li>
</ul>

the css....
#home .home, #about .about, #contact .contact {
color:#ffff00;
}

the html.....

<body id= "contact">
<ul>
<li><a href="home.html" class="home">Home</a></li>
<li><a href="about.html" class="about">About us</a></li>
<li><a href="contact.html" class="contact">Contact us</a></li>
</ul>
</body>

result---
"Contact us" is yellow because the class "contact" is inside the id "contact". Just change the ID of the page body to match the page content.

sneeu
09-19-2008, 03:35 AM
Awesome stuff man. It works thanks Opifex