Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] Div Problem For List Items

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #28294
    johnnydugs
    Member

    I am working on the main navigation for an ecommerce site: http://216.122.61.35/ and I have this background property that is taking over my life – any help is greatly appreciated.

    On my main navigation list items i am using css gradients for the active property.

    Code:
    #nav li.level0 a:hover, a:active {
    color: #FFF;
    background: #8d0a0a;
    background: -moz-linear-gradient(top, #1e1e1e, #3d3d3d);
    background: -webkit-gradient(linear, left top, left bottom, from(#1e1e1e), to(#3d3d3d));}

    Problem is that this background gradient is applying to every link that is pressed on the site. I am not a CSS expert, so hopefully this is an easy fix for you folks.

    Thanks for the help!

    #72079
    TheDoc
    Member

    Very easy fix.

    You need to make sure that you are selecting things properly!

    #nav li.level0 a:hover, a:active { }

    is NOT the same as

    #nav li.level0 a:hover, #nav li.level0 a:active { }

    See the difference?

    a:active = the entire site

    #nav li.level0 a:active = only your nave

    #72081
    noahgelman
    Participant

    TheDoc is right. You have to remember that commas separate entirely different targets. If you have a really long target, and you use a comma to separate it and another target, even if you’re only changing the end, you have to retype out the whole thing.

    #72143
    johnnydugs
    Member

    You guys freakin rock! :D

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.