Hi all, Is there is any way to deactivate the current page link in CSS I mean I have 3 link in my website. Home, AboutUs, Contact. If I am in the home page, I need to deactivate the link for Home but the link for AboutUs and ContactUs will be active. at same way, if I am in AboutUs page, I need to deactivate link for AboutUs but the link for Home and ContactUs will be active. Anybody can help me to do this in css. All are appreciate With regards shaji
CSS can't detect which page the user is viewing. You need a either a server-side language (PHP, ASP..etc) or JavaScript with CSS to accomplish this.
Ok, Thanx Then can you tell me how to do it by using Javascript and css. or any other way?? Regards shaji
Not true. Use id's. Look at the source of www.monochromedia.com/index.html: <body [COLOR="Red"]id="home"[/COLOR] class="body"> Code (markup): This tells the page which id it's on. li><a href="index.html" [COLOR="Red"]id="menu-home"[/COLOR]>Home</a></li> <li><a href="design.html" id="menu-design">Design</a></li> <li><a href="feedback.html" id="menu-feedback">Feedback</a></li> <li><a href="clients.html" id="menu-clients">Clients</a></li> <li><a href="faq.html" id="menu-faq">FAQ</a></li> <li><a href="weblog.html" id="menu-weblog">Weblog</a></li> <li class="bottom"><a href="contact.html" id="menu-contact">Contact</a></li> Code (markup): This tells the menu which id to assign to each link. Finally, we go to the CSS: [COLOR="red"]body#home a#menu-home[/COLOR], body#design a#menu-design, body#feedback a#menu-feedback, body#clients a#menu-clients, body#faq a#menu-faq, body#weblog a#menu-weblog{ background-image: url(http://www.monochromedia.com/images/2b.gif); } body#contact a#menu-contact{ background-image: url(http://www.monochromedia.com/images/3b.gif); } Code (markup): As far as deactivating the other links, I don't know. This will, however, allow you to style them accordingly. For more information, try this site: http://www.hicksdesign.co.uk/journal/highlighting-current-page-with-css. Or this one: www.google.com. Enjoy! -Peter
You'll use id's to tell CSS which link to decativiate (visually), but there's no way CSS can tell which page the user is viewing. Your site is using a server-side language to insert an ID for the current page. shaji, if you show me the site you're trying to implement this in, i might make a small javascript script for you to take care of it.
Sorry, misread the question - but after I had finished that long post, I didn't want to delete it. Hence: