开发者

Multiple Element Rollover Using CSS

开发者 https://www.devze.com 2023-03-24 05:26 出处:网络
I need to have divs show {border-bottom:solid 2px #F6开发者_如何学Python3} when a list item is rolled over.I played with .whatever:hover .whatever { but came up with nothing.Any suggestions?Without se

I need to have divs show {border-bottom:solid 2px #F6开发者_如何学Python3} when a list item is rolled over. I played with .whatever:hover .whatever { but came up with nothing. Any suggestions?


Without seeing your CSS/HTML, it's hard/impossible to post a solution. But as @James Khoury mentioned in the comment, you will need to place the div inside the li. So something like this...

<ul>
    <li class="first">First
        <div class="first">
            First
        </div>
    </li>
    <li class="second">Second
        <div class="second">
            Second
        </div>
    </li>    
</ul>

CSS

div{width:50px; height:50px; 
    border:1px solid blue; 
    margin:1em;}

li a{display:block;}

li.first:hover div.first, li.second:hover div.second{
    border-bottom:solid 2px #F63;}

http://jsfiddle.net/jasongennaro/6rjd9/

0

精彩评论

暂无评论...
验证码 换一张
取 消