By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,566 Members | 1,664 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,566 IT Pros & Developers. It's quick & easy.

changing color of menu link

pradeepjain
100+
P: 563
Hii guys,
I have a menu with 5 links with default color as white(text).I have a small prob...Say when i click on a link, I have to change the color or other links to grey .Is that possible through css
Dec 23 '08 #1
Share this Question
Share on Google+
3 Replies


drhowarddrfine
Expert 5K+
P: 7,435
If you meant to say "change the color of the other links to grey" then, no, it cannot be done with CSS.
Dec 23 '08 #2

alexjimenez
P: 6
I have the feeling you could achieve something similar with Javascript :

see this page for example about "EVENTS" :

Javascript For Beginners

Research about "OnMouseOver" and "OnClick"



Also you could do this with CSS but on the other page you have to manually code the CLASS or ID for other links to be 'gray' 'ed out

That one is not really dynamic :

Simple Hover | 13styles CSS Menus


But in Pure CSS...that is not really possible ....i would do your link trick with Javascript Events ....



Merry Christ 'mass'
Dec 23 '08 #3

alexjimenez
P: 6
You can also define CSS attributes with PHP

say mixing HTML+CSS+PHP :


If url = index.php


then use this Class for this Link color

Else

use this link color .... for each menu link.

***This is not the Real PHP Code, but will help you understand what PHP or other languages can do!
Dec 23 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.