em 与p 标签上下对不齐,关键在于设置em样式
em 与p 标签上下对不齐, 是要给 em 加如下代码
display:block;
float:left;
完整记录如下
<style type="text/css">
/*在此定义相关CSS样式*/
.topList{
width:500px;
height:180px;
border:1px solid #E8e8e8;
font-size:12px;
margin:5px;
}
ul li{
list-style-type:none;
}
em{
width:20px;
height:16px;
font-style:normal;
background:url(http://img1.sycdn.imooc.com//53cf0fa20001d3dc00200032.jpg);
background-size: 50px 50px;
background-position: 0 -25px;
display:block;
text-align:center;
line-height:16px;
float:left;
}
.top em {
background:url(http://img1.sycdn.imooc.com//53cf0fa20001d3dc00200032.jpg);
background-size: 50px 50px;
color:white;
}
a{
text-decoration:none;
color:gray;
}
a:hover,a:active{
text-decoration:none;
color:#c00;
}
</style>