CSS HELP!

Discussion in 'HTML & Website Design' started by drew68, Jul 30, 2013.

  1. #1
    how can i get the menu navigation links to turn yellow on hover?

    here's my css for the navigation menu...

    .menu {
    position: relative;
    display: inline-block;
    margin-top: 128px;
    }
    #menu>li {
    display: inline-block;
    position: relative;
    width: 230px;
    height: 53px;
    margin-top: -13px;
    background: url(../images/menu_div.png) center 42px no-repeat;
    }
    #menu>li.no_disp {
    display: none;
    }
    #menu>li>a {
    position: relative;
    display: block;
    font: 21px/24px 'Century Gothic', serif;
    color: #78685e;
    text-transform: uppercase;
    margin: 12px 0;
    z-index: 20;
    }
    #menu>li>strong{
    display: inline-block;
    position:absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 10;
    background: url(../images/menu_bg.png) center no-repeat;
    height: 0;
    }


    PLEASE HELP! thanks!
     
    drew68, Jul 30, 2013 IP
  2. Jeff Bee

    Jeff Bee Greenhorn

    Messages:
    31
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    18
    #2
    Are you talking about a href links? If so, you can use the following:

    a:hover {color:yellow;}

    or

    a:hover {background-color:yellow;}

    The first one changes the color of the actual text, the second changes the colour of the background around the text.

    Hope that helps.
     
    Jeff Bee, Jul 30, 2013 IP
  3. drew68

    drew68 Well-Known Member

    Messages:
    582
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    128
    #3
    jeff..where do i put this? #menu>li a:hover {color:#f8f83c;}
     
    drew68, Jul 30, 2013 IP
  4. alkantenik

    alkantenik Well-Known Member

    Messages:
    190
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    138
    #4
    You will put it in your style.css
    If you can send your url, I can find its exact way.
     
    alkantenik, Jul 30, 2013 IP
  5. drew68

    drew68 Well-Known Member

    Messages:
    582
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    128
    #5
    i know it's suppose to go inside the style.css but not sure where in there. thanks alkantenik
     
    drew68, Jul 30, 2013 IP
  6. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #6
    Have it follow this bit, like so:
    #menu>li>a {
      position: relative;
      display: block;
      font: 21px/24px 'Century Gothic', serif;
      color: #78685e;
      text-transform: uppercase;
      margin: 12px 0;
      z-index: 20;    /*If you need this, you probably screwed something up*/
    }
     
    #menu>li a:hover {
      color:#f8f83c;
      }
    Code (markup):
    cheers,

    gary
     
    Last edited: Jul 30, 2013
    kk5st, Jul 30, 2013 IP
  7. drew68

    drew68 Well-Known Member

    Messages:
    582
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    128
    #7
    kk...i can't believe that your code is not working. i've tried just about everything and it's not working
     
    drew68, Jul 30, 2013 IP
  8. DrShirts

    DrShirts Peon

    Messages:
    28
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    1
    #8
    Try
       
    #menu>li>a:hover {
          color:#f8f83c;
          }
    
    Code (markup):
     
    DrShirts, Jul 30, 2013 IP
  9. drew68

    drew68 Well-Known Member

    Messages:
    582
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    128
    #9
    thanks try..it's not working though...there's something about this html theme.
     
    drew68, Jul 30, 2013 IP
  10. alkantenik

    alkantenik Well-Known Member

    Messages:
    190
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    138
    #10
    You have to send your website url Drew.
    You can send PM.
     
    alkantenik, Jul 30, 2013 IP
  11. drew68

    drew68 Well-Known Member

    Messages:
    582
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    128
    #11
    actually i got it to work here...thanks alk!

    #menu>li>a:hover, #menu a:hover, #menu>li>a:active, #menu a:active {
    color: #a91e28 !important ;
    }
     
    drew68, Jul 30, 2013 IP
  12. Jennifer M.

    Jennifer M. Member

    Messages:
    13
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    33
    #12
    The fact that you had to put !important there means that it most likely is already being defined somewhere else in your code. Are you using a template? You might want to check and see if there are any website-general a:hover codes near the beginning of your code that may have been overriding your changes.
     
    Jennifer M., Jul 31, 2013 IP
  13. sansarahub

    sansarahub Greenhorn

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #13
    you ask href link ??
     
    sansarahub, Jul 31, 2013 IP
  14. Joydev Pal

    Joydev Pal Greenhorn

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #14
    #menu li a:hover {color:yellow}
    you can use hex code to replace color name.
     
    Joydev Pal, Aug 2, 2013 IP
  15. stevie21

    stevie21 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #15
    go to htmlgenerators.com and download the freeware.
     
    stevie21, Aug 5, 2013 IP
  16. DrShirts

    DrShirts Peon

    Messages:
    28
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    1
    #16
    I'd use FIREBUG to inspect and see if the code is being overridden.
     
    DrShirts, Aug 5, 2013 IP
    kk5st likes this.
  17. karthick9

    karthick9 Member

    Messages:
    575
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    33
    #17
    menu>>li>>a:hover{ color:Yellow;} (Text color will be yellow when you hover)
    menu>>li>>a:hover{ background color:Yellow;} (background color for that particular tab will be yellow when you hover)
     
    karthick9, Aug 9, 2013 IP
  18. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #18
    That is invalid syntax. You should validate and test any code or markup before posting something that will lead others wrong. If you disagree that it is invalid, please post the relevant reference to the specs.
     
    kk5st, Aug 9, 2013 IP