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;
}

  

posted @ 2020-01-08 15:43  绿林豪士  阅读(472)  评论(0编辑  收藏  举报