主要是中间的分割线,效果图如下:
Html代码:
<div class="fuwu"> <ul> <li><a href=""><i class="iconfont icon-shizhong"></i><span>保障服务</span></a></li> <li><a href=""><i class="iconfont icon-tuangou"></i><span>企业团购</span></a></li> <li><a href=""><i class="iconfont icon-fenxiang"></i><span>F码通道</span></a></li> <li><a href=""><i class="iconfont icon-wifidianhuaqia"><span>米粉卡</span></a></i></li> <li><a href=""><i class="iconfont icon-icon-test"></i><span>以旧换新</span></a></li> <li><a href=""><i class="iconfont icon-chongzhi"></i><span>话费充值</span></a></li> </ul> </div>
CSS代码:
.fuwu { 234px; height: 170px; float: left; background: #5f5750; } .fuwu A { color: #d6cdcd; } .fuwu A:hover { color: rgb(255, 253, 253); } .fuwu ul { overflow: hidden; } .fuwu li { 75px; height: 83px; float: left; margin: 1px; text-align: center; position: relative; }
/* 以下2个伪类主要通过控制边框长度实现分割线效果 */ .fuwu ul li:before { content: ''; position: absolute; top: -1px; left: 6px; 64px; height: 1px; background: #665e57; } .fuwu ul li:after { content: ''; position: absolute; top: 6px; left: 0; 1px; height: 70px; background: #665e57; } .fuwu i { font-size: 28px; display: block; margin-top: 13px; margin-bottom: 2px; } .fuwu span { font-size: 12px; display: block; }