changing color of menu link

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pradeepjain
    Contributor
    • Jul 2007
    • 563

    #1

    changing color of menu link

    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
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    If you meant to say "change the color of the other links to grey" then, no, it cannot be done with CSS.

    Comment

    • alexjimenez
      New Member
      • Dec 2008
      • 6

      #3
      I have the feeling you could achieve something similar with Javascript :

      see this page for example about "EVENTS" :

      Javascript For Beginners

      Research about "OnMouseOve r" 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'

      Comment

      • alexjimenez
        New Member
        • Dec 2008
        • 6

        #4
        also possible in PHP or other languages...

        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!

        Comment

        Working...