gpt4 book ai didi

html - li 列表的悬停效果

转载 作者:太空宇宙 更新时间:2023-11-04 15:37:09 26 4
gpt4 key购买 nike

我有一个 <ol>我添加了颜色的列表。这工作正常。但是当我添加一个有 2 个标签的 div 时,悬停效果不适用。

在我的代码中,悬停没有发生第二次 <li> .

HTML:

<div class="test">
<ol>
<a href="#"><li><div><span>test 1</span><p>Mvdshe</p></div></li></a>
<a href="#"><li><div><span>test 12</span><p>sdgmksgb</p></div>
<div class="icons"><a href="#" class="play"></a><span class="dividr"></span><a href="#" class="suffle"></a></div></li></a>
<a href="#"><li><div><span>test 11</span><p>Name dgdg</p></div></li></a>
</ol>
</div>

CSS:

.test{ position:relative; height:auto; width:100%}
.test ol{margin:0; padding:0; font:normal 30px 'SegoeWPLight', Verdana, Geneva, sans-serif; color:#afafaf; text-align:left; list-style:none; counter-reset: listCounter;}
.test ol li{vertical-align:middle; padding:10px 20px; border-bottom:#d4d4d4 solid 1px; border-top:#fff solid 1px; counter-increment: listCounter;}
.testol li:before { content: counter(listCounter) " "; width:30px; margin-right:15px; display: inline-block; text-align: right; }
.test ol li span{vertical-align:middle; display:block; color:#008fcd; font:normal 18px 'SegoeWPLight', Verdana, Geneva, sans-serif;}
.test ol li p{vertical-align:middle; display:block; margin:0; padding:0; font:normal 14px 'SegoeWPLight', Verdana, Geneva, sans-serif; color:#797979;}
.test ol li img{vertical-align:middle; padding-left:10px }
.test ol li div{ display:inline-block; margin-left:25px; vertical-align:middle; }
.test ol a{ text-decoration:none; font:normal 30px 'SegoeWPLight', Verdana, Geneva, sans-serif; color:#afafaf;}
.test ol a:hover li{ background-color:#f4f4f4}
.test ol a.mus_active li{ background-color:#f4f4f4}
.icons{display:inline-block; float:right; vertical-align:middle; width:auto; margin-top:20px}
.play{background:url(http://www.timeshighereducation.co.uk/magazine/graphics/search_icon_big.gif) no-repeat left; width:25px; height:25px; background-size:15px; display:inline-block !important; }
.suffle{background:url(../images/suffle.png) no-repeat left; width:25px; height:25px; display:inline-block !important}
.dividr{background:url(http://www.timeshighereducation.co.uk/magazine/graphics/search_icon_big.gif) no-repeat left; width:3px; height:28px; display:inline-block !important; margin:0 8px 10px 0}

View this code at JSFiddle

最佳答案

试试这个 http://jsfiddle.net/bFVGr/2/

.test ol li { vertical-align:middle;  border-bottom:#d4d4d4 solid 1px; border-top:#fff solid 1px; counter-increment: listCounter; }

.test ol li > a{display:block; padding:10px 20px;}

.test ol li > a:hover { background-color:#f4f4f4 }

关于html - li 列表的悬停效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12636718/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com