為什么我劃過li的時(shí)候紅色背景塊顯示的沒有最終效果一樣大
<style type="text/css">
/*在此定義相關(guān)樣式,控制列表的顯示形式*/
body{
? ? height:150px;
? ? width:300px;
? ? ?border:1px solid white;
h3{
? ? font-size:;20px;
? ? font-weight:bold;
?
}
.mid{
? ? height:80px;
}
? ?
}
.mid li{
? ? list-style-type:none;
? ? float:left;
? ? margin-right:10px;
? ??
}
.mid a:link,a:visited{
? ? text-decoration:none;
? ? color:black;
}
.mid a:hover,a:active{
? ? color:white;
? ?background-color:#be3948;
? ?display:block;
}
</style>
2017-08-20
li要加高度和行高
line-height: 30px;
height: 30px;
2018-02-24
a{display:block;
height:30px;
width:50px;}
a:hover{
background:red;}
2017-11-22
設(shè)置li:hover{
background:red}就可以了
2017-08-19
的確有些奇怪。。。試了一下