Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS Drop down menu Hover

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!

like image 351
Bac0 Avatar asked Aug 26 '26 06:08

Bac0


1 Answers

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/

like image 191
Explosion Pills Avatar answered Aug 28 '26 04:08

Explosion Pills



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!