SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    May 2001
    Location
    Tallahassee, FL
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS hover for menu text only

    I would like to use the CSS hover effect for certain text, not the entire site. Specifically, I would like to have the text on menu change color on mouse over here:
    http://www.allthingschristmas.com/dw/

    I've been checking the Internet for a few hours and haven't found a way to do this yet (or at least not one that works in IE6 which I'm using).

    Any help would be appreciated.

    Deborah Whipp

  2. #2
    011521 dbalsdon's Avatar
    Join Date
    Feb 2003
    Location
    North Of Scotland
    Posts
    444
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the code below will make a link change colour from blue to red when a user hovers over it, and will change back to blue when the mouse moves off the link

    a { color: blue; }
    a:visited { color: blue; }
    a:active { color: blue; }
    a:hover { color: red; }

    the code above will apply to all the links on the page...

    this can be easily changed to apply only to the menu links.. by using classes..

    a.menu { color: blue; }
    a.menu:visited { color: blue; }
    a.menu:active { color: blue; }
    a.menu:hover { color: red; }

    to make the code above work.. just add class="menu to the links you want to be affected...

    so..

    <a href="target" class="menu">link color will change when hovered over</a>
    Daniel Balsdon
    My Site

  3. #3
    SitePoint Zealot
    Join Date
    May 2001
    Location
    Tallahassee, FL
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was messing around with my css and got pretty close, but couldn't quite fix it. Now it's working perfectly - thanks so much.
    Deborah


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
  •