為何要用:target 直接用#選擇器選擇ID匹配的不久行了嗎?求大神告知
#brand:target {
?background: orange;
?color: #fff;
}#jake:target {
?background: blue;
?color: #fff;
}#aron:target {
?background: red;
?color: #fff;
}
#brand:target {
?background: orange;
?color: #fff;
}#jake:target {
?background: blue;
?color: #fff;
}#aron:target {
?background: red;
?color: #fff;
}
2017-03-15
舉報
2017-03-15
看W3C的解釋, :target?可用于選取當前活動的目標元素
直接用ID匹配, 不代表這個目標元素就是活動的撒.
2017-03-15
正確, 對的