SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot get_dave's Avatar
    Join Date
    Nov 2006
    Location
    England, UK
    Posts
    191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation CSS Drop Nav - want top level :hover to persist on drop

    Hi and many thanks for your help.

    I have created a horiztonal drop down nav using only CSS. I have it so that when you hover over the top level links the background changes to yellow. However when I "drill" into the drop down menu the :hover style on the top level parent [of that drop down] doesn't persist (ie: it returns to it's "non-hover" state).

    What i want is: when I move into the drop down menu, I want the :hover style on the top level parent link to persist.

    I tried using this already:

    Code:
    ul.pri-nav:hover > a
    But it doesn't seem to work. PLEASE SEE SCREEN SHOT! Any help would be appreciated. Many thanks

    David
    Attached Images Attached Images
    I'm looking for a link exchange.
    contact me or head to:
    http://www.aheadcreative.co.uk

  2. #2
    SitePoint Wizard bronze trophy Centauri's Avatar
    Join Date
    May 2007
    Location
    Newcastle, Australia
    Posts
    3,718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bit hard to advise accurately without code or link, but when the second level dropdown is activated by li:hover, then the top level hover effect must also be done on the li hover. So instead of the top level hover effect being done by a:hover { }, it should be done with li:hover a { }.

  3. #3
    SitePoint Zealot get_dave's Avatar
    Join Date
    Nov 2006
    Location
    England, UK
    Posts
    191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey,

    Thanks loads. That was it. I had it working before but then could never find the selector i'd used when i rewrote the css earlier this month.

    My solution is:

    ul.pri-nav li:hover

    and that works
    I'm looking for a link exchange.
    contact me or head to:
    http://www.aheadcreative.co.uk


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
  •