已采纳回答 / 皇皇儿
因为内联模型的高度是由行框是由content内容区和行间距(line-height - content.height)构成的,渲染时会将行间距除2并分别应用到内容区的顶部和底部。
2015-08-02
最新回答 / Yvonne_D
Explain:The first value is the horizontal position and the second value is the vertical. The top left corner is 0 0. Units can be pixels (0px 0px) or any other CSS units. If you only specify one value, the other value will be 50%. You can mix % and positi...
2015-07-31
li{list-style-type:none;float:left;width:50px;height:30px;}
a{text-decoration:none;display:block;color:#000;line-height:30px;text-align:center;}
a:hover{background:#BE3948;color:#fff;}
<h3>课程难度</h3>
<ul>
<li><a href="#">全部</a></li>
<li><a href="#">初级</a></li>
</ul>
a{text-decoration:none;display:block;color:#000;line-height:30px;text-align:center;}
a:hover{background:#BE3948;color:#fff;}
<h3>课程难度</h3>
<ul>
<li><a href="#">全部</a></li>
<li><a href="#">初级</a></li>
</ul>