Results 1 to 3 of 3

Thread: Creating current state on glossy vertical menu

  1. #1
    Join Date
    Mar 2009
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question Creating current state on glossy vertical menu

    Hi can anybody help me create a current state on the vertical glossy menu here's the css. Thanks Bill

    [<style type="text/css">

    /*Credits: Dynamic Drive CSS Library */
    /*URL: http://www.dynamicdrive.com/style/ */

    .glossymenu{
    list-style-type: none;
    margin: 5px 0;
    padding: 0;
    width: 170px;
    border: 1px solid #9A9A9A;
    border-bottom-width: 0;
    }

    .glossymenu li a{
    background: white url(media/glossyback.gif) repeat-x bottom left;
    font: bold 13px "Lucida Grande", "Trebuchet MS", Verdana, Helvetica, sans-serif;
    color: white;
    display: block;
    width: auto;
    padding: 3px 0;
    padding-left: 10px;
    text-decoration: none;

    }


    * html .glossymenu li a{ /*IE only. Actual menu width minus left padding of A element (10px) */
    width: 160px;
    }

    .glossymenu li a:visited, .glossymenu li a:active{
    color: white;
    }

    .glossymenu li a:hover{
    background-image: url(media/glossyback2.gif);
    }

    </style>]

    And the HTML

    [<ul class="glossymenu">
    <li><a href="http://www.dynamicdrive.com/" >Dynamic Drive</a></li>
    <li><a href="http://www.dynamicdrive.com/style/" >CSS Examples</a></li>
    <li><a href="http://www.javascriptkit.com/jsref/">JavaScript Reference</a></li>
    <li><a href="http://www.javascriptkit.com/domref/">DOM Reference</a></li>
    <li><a href="http://www.cssdrive.com">CSS Drive</a></li>
    <li><a href="http://www.codingforums.com/" style="border-bottom-width: 0">Coding Forums</a></li>
    </ul>]
    Last edited by Muneio; 03-06-2009 at 05:37 AM.

  2. #2
    Join Date
    Feb 2009
    Posts
    303
    Thanks
    18
    Thanked 36 Times in 36 Posts

    Default

    A simple way to do this is simply add an id to one of the links, here's the easiest way:

    CSS:
    Code:
    .glossymenu li a:hover, .glossymenu li a#current{
    background-image: url(media/glossyback2.gif);
    }
    HTML:
    Code:
    <li><a href="http://www.dynamicdrive.com/" id="current">Dynamic Drive</a></li>
    Hope that helps!
    Last edited by X96 Web Design; 03-06-2009 at 03:22 AM. Reason: highlight
    Alex Blackie, X96 Design
    My Website
    I specialize in: HTML5, CSS3, PHP, Ruby on Rails, MySQL, MongoDB, Linux Server Administration

  3. The Following User Says Thank You to X96 Web Design For This Useful Post:

    Muneio (03-06-2009)

  4. #3
    Join Date
    Mar 2009
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Thumbs up

    Very cool Thanks!!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •