慕用3285105
2018-07-16 11:35
.nav li:after{
content:"";
position:absolute; /*绝对定位*/
right:0px; /*移动*/
top:20px; /*移动*/
height:15px; /*高*/
width:2px; /*宽*/
background:linear-gradient(to bottom,#f82f87,#B0363F,#f82f87); /*设f分割线背景为渐变色*/
}
/*删除第一项和最后一项导航分隔线*/
.nav li:last-child:after{
width:0px;
height:0px;
}
就算我换成.nav li:before最后还是在home的后面出先导航线,而且把.nav li:first-child:before改成这样也是home后面的那一个删去
.nav li::before {
content: '';
width: 1px;
height: 20px;
position: absolute;
top: 20px;
left: 0;
background-image: linear-gradient(to right, #FFFFFF, gray);
}
.nav li:first-child::before {
content: '';
background-image: none;
}
还是要在后面加的浏览器问题
十天精通CSS3
243145 学习 · 2677 问题
相似问题