3

I need a help. I was doing a drop up menu with share icons. My problem is this: I'd like that when I pass the mouse over the main-share icon in the footer and than go to select another icon (like facebook), the main icon remains selected like as mouse hover, but it don’t works.

<div class="footer large blue">Footer Blue
<div class="pull-right buttons">
    <ul>
        <li><a class="btn2 large share2 blue" href="#">Share</a>

            <ul>
                <li><a class="btn large rss" href="#">RSS</a>

                </li>
                <li><a class="btn large twitter" href="#">Twitter</a>

                </li>
                <li><a class="btn large plus" href="#">G+</a>

                </li>
                <li><a class="btn large facebook" href="#">Fb</a>

                </li>
            </ul>
        </li>
        <li><a class="btn2 large btt blue" href="#">Back to Top</a>

        </li>
    </ul>
</div>

I think the problem is that the elements li and a, are two independent tags.

Watch this image to understand it better what am i saying (because i’m not able to explain it better ._.)

http://db.tt/Kujz3Pv4

Here's the code: http://jsfiddle.net/zPavan/KHWJ4/2/

If there are any problems or have suggestions on the code, I thank you for the advice!

1
  • +1 Well formed question! See this fiddle from this answer. Commented Feb 4, 2013 at 22:49

2 Answers 2

4

Instead of depending on the hovering of the <a> specifically, make it depend on the list item that contains the entire <ul>:

li:hover > .btn2.blue {
    background-color: hsl(197, 59%, 30%);
}

I would suggest giving that specific li a class like .share that you can use as well.

http://jsfiddle.net/ExplosionPIlls/KHWJ4/3/

Sign up to request clarification or add additional context in comments.

Comments

0

I think this will do it:

.buttons ul li:hover > a {
    background-color: #1f5f79;
} 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.