css nth-child 选择器的使用

nth-child()不是从0开始的,是从1开始的
.index-one li:nth-child(1):hover {
    background: url(../images/one_bg.jpg) no-repeat;
}

.index-one li:nth-child(2):hover {
    background: url(../images/one_bg.jpg) no-repeat;
}

.index-one li:nth-child(3):hover {
    background: url(../images/one_bg.jpg) no-repeat;
}

  

原文地址:https://www.cnblogs.com/xinlvtian/p/12166995.html