1

Here's the list and items:

<ul>
    <li>
        <a href="#">Home</a>
    </li>
    <li>
        <a href="#">Forums</a>
        <ul>
            <li>
                <a href="#">Baseball</a>
                <ul>
                    <li>
                        <a href="#">Trading</a>
                    </li>
                    <li>
                        <a href="#">Personal Collections</a>
                    </li>
                    <li>
                        <a href="#">Box Breaks</a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="#">Basketball</a>
                <ul>
                    <li>
                        <a href="#">Trading</a>
                    </li>
                    <li>
                        <a href="#">Personal Collections</a>
                    </li>
                    <li>
                        <a href="#">Box Breaks</a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="#">Football</a>
                <ul>
                    <li>
                        <a href="#">Trading</a>
                    </li>
                    <li>
                        <a href="#">Personal Collections</a>
                    </li>
                    <li>
                        <a href="#">Box Breaks</a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="#">Hockey</a>
                <ul>
                    <li>
                        <a href="#">Trading</a>
                    </li>
                    <li>
                        <a href="#">Personal Collections</a>
                    </li>
                    <li>
                        <a href="#">Box Breaks</a>
                    </li>
                </ul>
            </li>
        </ul>
    </li>
</ul>

Here's the CSS:

ul
{
    margin: 0;
    padding: 0;
    list-style: none;
    width: 100px;
    border-bottom: 1px solid #ccc;
}

a
{
    color: #777;
}

a:hover
{
    background-color: #fff;
}

ul li
{
    position: relative;
}

li ul
{
    display: inline;
    position: absolute;
    left: 99px;
    top: 0;
    display: none;
}

li ul li ul
{
    width: 150px;
}

ul li a
{
    display: block;
    text-decoration: none;
    background: #bad8f8;
    padding: 2px 0 2px 10px;
    border: 1px solid #ccc;
    border-bottom: 0;
}

li:hover > ul
{
    display: block;
}

What I want to happen is when I hover over Forums, it highlight white. Then if I go over Basketball, Forum and Basketball are highlighted white. And the same goes for the children. I want to be able to show a path so when they over over something, while positioning should be able to tell them which one they're accessing, I want the highlighting to make it clear. Any help would be appreciated. Oh, and please no Javascript if possible. Thanks.

This is what it looks like now when I hover over the last child: alt text

And the red circled ones I also want to be highlighted white. alt text

Update
This is what I'm going to have to accept. It's ugly, for now, but that's the best I can come up with. alt text

DisplayName
  • 3,065
  • 5
  • 36
  • 40
XstreamINsanity
  • 3,748
  • 9
  • 42
  • 59

1 Answers1

2

Keeping the parent in the 'selected' state as you navigate down the nested ul lists probably is not possible in CSS. I don't think CSS selectors are able to ascend up the tree. This should not be difficult using javascript though. Here is a reference:

Complex CSS selector for parent of active child

Bob

Community
  • 1
  • 1
rcravens
  • 8,060
  • 2
  • 30
  • 25