伪元素的使用之面包屑导航
关于面包屑导航,网上有很多参考案例,这里就不一一说明了,只说明我遇到过的问题。
效果图如下:
我的效果图如下:
ol li{
height: 40px;
line-height: 40px;
list-style: none;
float: left;
}
ol li:after{
color: #ccc;
content: "";
display: inline-block;
width: .242rem;
height: .966rem;
background: url(../images/icon.png);
background-size: 100% 100%;
}
将content设为空,然后设置这个元素为行内块,设置这个元素的背景图片就行了,还可以根据自己想要的效果调整背景的大小与位置