Highlighting Current Selection on Menus

Discussion in 'HTML & Website Design' started by Extranet Guy, Feb 5, 2005.

  1. #1
    What's the easiest way for a newbie to have the currently selected item on a navigation menu be a different color (without having to specify each page separately)? Would be doubly appreciative if anyone can point me to any free code to do this .
     
    Extranet Guy, Feb 5, 2005 IP
  2. Smyrl

    Smyrl Tomato Republic Staff

    Messages:
    13,740
    Likes Received:
    1,702
    Best Answers:
    78
    Trophy Points:
    510
    #2
    On rereading your question see I opened mouth and inserted not too tasty foot. I do not know how to do so. Sorry about the mis-information.

    ---------

    Using a CSS should do so. I have used style statements on individual pages but you could accomplish same thing with a cascading style sheet. Let me look for the basic code.

    Shannon

    Try playing around with this is head section of your html until you get something pleasing them move to a cascading style sheet. Do a search for cascading style sheet tutorial online. Thought I had one bookmarked but do not.

    <STYLE TYPE="text/css">
    <!--

    a {
      font-family:Arial,Verdana,sans-serif;
    color:#003366;
      text-decoration:underline
    font-size:10pt;
      font-weight:bold;
    }

    a:hover {
    font-family:Arial,Verdana,sans-serif;
    background-color:#ffffff;
      color:#333333;
      text-decoration:underline;
    font-size:10pt;
      font-weight:bold;
    }


    -->
    </style>

    you can set text-decoration to none if desired, font-weight can be bold or normal etc. You can leave background color alone or changed color behind your link to create mouse-over effect.
     
    Smyrl, Feb 5, 2005 IP
  3. Extranet Guy

    Extranet Guy Well-Known Member

    Messages:
    99
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    138
    #3
    Using CSS would be ideal, but it seems like you also need some kind of conditional logic...if "current page", then format "white". If you find the code, that would be great. Thanks.
     
    Extranet Guy, Feb 5, 2005 IP