針對練習題,“切換背景圖像綜合練習題”,為什么第二種寫法不對?
寫法1(正確)? .slider li:nth-of-type(1) a{
??????????? background-color: #02646e;
??????????? }
寫法2(錯誤)? .slider a:nth-of-type(1){
??????????? background-color: #02646e;
??????????? }
寫法1(正確)? .slider li:nth-of-type(1) a{
??????????? background-color: #02646e;
??????????? }
寫法2(錯誤)? .slider a:nth-of-type(1){
??????????? background-color: #02646e;
??????????? }
2016-04-19
舉報
2016-04-22
對的。。
2016-04-22
偽類元素接鏈接是有條件限制的
2016-04-19
知道原因了,因為各a不是兄弟關系?。。。。。。?!而li是,也可寫成li:nth-of-type(1) a