td:nth-child(3){background-color:#000; color:#fff;}/*把第3個td的背景設為黑色*/
:nth-child()不止可以給table指定樣式
p標簽頁是可以的,規定屬於其父元素的第二個子元素的每個 p 的背景色:
p:nth-child(2) { background:#ff0000; }
td:nth-child(3){background-color:#000; color:#fff;}/*把第3個td的背景設為黑色*/
p標簽頁是可以的,規定屬於其父元素的第二個子元素的每個 p 的背景色:
p:nth-child(2) { background:#ff0000; }
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。