SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    May 2013
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking Targetting li elements within a parent li

    Hi everyone,

    I would be grateful for any help with this as I have tried various combinations but can't get it to work.

    I want the dropdown in the navigation on this page http://www.gravesendctc.org.uk/rider...cord-page.html
    to be always white, not just on rollover.

    I want it to be like it is on this page http://www.gravesendctc.org.uk/index.html (but this navbar is a javascript one)

    Could someone please take a look at my CSS and see what I need to do http://www.gravesendctc.org.uk/rider...cordstyles.css

    Thanks very much
    from
    Richard

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,367
    Mentioned
    180 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    Change this rule:

    Code:
    nav ul li:hover a { color: #00C !important; }
    To this rule:

    Code:
    nav ul li:hover > a { color: #00C !important; }
    (Note the child selector (>) is only supported in IE7+ but I guess seeing as you don't have the html5 shiv in place that you are only supporting IE9+ anyway.)

    Don't throw !important around as its not really needed if you get the specificity right and just complicates issue unless you know why you used it.

  3. #3
    SitePoint Member
    Join Date
    May 2013
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks ever so much, I thought it would be something simple! and thanks for the tip about the 'important!'.
    from
    Richard


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
  •