编辑下面的代码:【加编码】
<html> <head> <style> li:first-child { background:yellow; } </style> </head> <body> <ul> <li>Coffee</li> <li>Tea</li> <li>Coca Cola</li> </ul> <ol> <li>Coffee</li> <li>Tea</li> <li>Coca Cola</li> </ol> <p><b>Note:</b> For :first-child to work in IE8 and earlier, a DOCTYPE must be declared.</p> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂