Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.5a is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthornein
    • CommentTimeMar 2nd 2008
     permalink
    I'm sure this is the easiest of questions. I have been studying the css of this navigation for hours and I can't seem to figure out how it works. (http://simplebits.com/about/) Dan's done a great job here but I can't quite seem to figure out how he did it. The right sub navigation, what I am trying to do is make it so when you hover anywhere in the list area, it sees it as a link.

    The problem is I can only get it to change the background color, and you need to hover over the text to actually make it a link. Could anyone explain how to go about setting something like this up, or is there a tutorial somewhere I can read?

    Here is the html followed by the css.

    <ul class="subnav">
    <li class="active"><a href="pricing.html">General Pricing</a></li>
    <li><a href="testimonials.html">Client Testimonials</a></li>
    <li><a href="catalog.html">Music Catalog</a></li>
    <li class="sub-last"><a href="faq.html">Frequently Asked Questions</a></li>
    </ul>

    /* Sub Navigation */

    .subnav, .subnav li {
    width: 100%;
    }

    .subnav li {
    border-bottom: 1px dotted #d5d4d4;
    padding: 1em 0 1em 2.5em;
    background: url(images/arrow.gif) 6px 17px no-repeat;
    width: 100%
    }

    .subnav a {
    color: #b8b8b8;
    width: 100%;
    }

    .subnav a:hover {
    color: #947681;
    }

    li.sub-last {
    border: 0;
    }

    .subnav li:hover{
    background: #f3f3f3 url(images/arrow_hover.gif) 6px 17px no-repeat;
    }

    .subnav li.active {
    background: #f3f3f3 url(images/arrow_on.gif) 6px 17px no-repeat;
    color: #333;
    }

    li.sub-last {
    border: 0;
    }

    Any help would be greatly appreciated. Thanks!

    James
  1.  permalink
    code looks ok ..except for the one below .. needs a space after hover...

    .subnav li:hover{
    background: #f3f3f3 url(images/arrow_hover.gif) 6px 17px no-repeat;
    }

    you should also have everything in a division to test it correctly .. since the division will isolate it from the rest of the sheet/page...

    you could also look at the post i made here since it includes a menu ... its in anything goes area... need page tested is the topic I think...

    hope this helps mate...
  2.  permalink
    Hi Nein,

    Fairly simple solution - just add display: block; to your .subnav a declaration. It should now read:

    .subnav a {
    color: #b8b8b8;
    width: 100%;
    display: block;
    }

    Hope this helps,

    A
    • CommentAuthornein
    • CommentTimeMar 2nd 2008
     permalink
    Wow, I can't believe how simple that was! Sorry about the css, it was really messy since I was trying everything I knew. Thanks a lot apricot!
Add your comments
    Username Password
  • Format comments as (Help)