编辑下面的代码:【加编码】
<html> <head> <style> p:nth-last-child(3n+0) { background:#ff0000; } </style> </head> <body> <p>The first paragraph.</p> <p>The second paragraph.</p> <p>The third paragraph.</p> <p>The fourth paragraph.</p> <p>The fifth paragraph.</p> <p>The sixth paragraph.</p> <p>The seventh paragraph.</p> <p>The eight paragraph.</p> <p>The ninth paragraph.</p> <p><b>Note:</b> Internet Explorer 8 and earlier versions do not support the :nth-last-child() selector.</p> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂