Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Oct 2006
    Posts
    197
    Thanks
    9
    Thanked 0 Times in 0 Posts

    CSS hover code, doesnt change :o

    Im trying to change my menu blocks when the user hovers over them, both the background colour and the text colour. I found a tutorial and so i followed it but the menu doesnt change when i hover over it.

    This is the code for the menu blocks up top:
    #header ul a {
    line-height: 1em;
    padding: .2em;
    border: 1px solid #000000;
    float: left;
    text-transform: uppercase;
    text-decoration: none;
    color: #aae2ff;
    background: #1f1f1f;
    font-size: 1em;
    font-weight:bold;
    }
    So i added this to my css as an example:

    #header ul a:hover {
    border: 2px solid #000000;
    background: #333333
    color: #ffffff;
    }
    But when i hover it doesnt change. Is anyone able to tell me what im doing wrong? I can supply my full css / html if that helps.

    James

  • #2
    Regular Coder Jutlander's Avatar
    Join Date
    Jun 2007
    Location
    In my own sick little world :P
    Posts
    425
    Thanks
    1
    Thanked 12 Times in 12 Posts
    It may be the case that you need li in there like this:

    Code:
    #header ul li a
    
    #header ul li a:hover
    But can you show your HTML?
    .
    .

  • #3
    New Coder
    Join Date
    Aug 2007
    Location
    Minnesota
    Posts
    21
    Thanks
    0
    Thanked 1 Time in 1 Post
    also, you are missing a ; after your background color change in your hover code....sometimes small stuff like that changes everything.


  •  

    Posting Permissions

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