請(qǐng)問(wèn) ul > li:first-child{ color: red; } 與 ul > li :first-child{ color: red; } (li與:first-child之間有空格)的差異
請(qǐng)問(wèn)為什么 ul > li:first-child{ ?color: red; } 顯示 li 圓點(diǎn)為紅色,而 ul > li :first-child{ ?color: red; } (li與:first-child之間有空格)卻變成各 li 下的文字變成紅色呢?請(qǐng)問(wèn)是因?yàn)榭崭翊砗蟠x擇器嗎?
2015-10-09
li:first-child表示ul的第一個(gè)子元素;
li :first-child無(wú)效的選擇,選取為li