隔行换色
作者:互联网
Documen
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style>
//奇数 tr:nth-child(even) { background-color: aqua; }
//偶数 tr:nth-child(odd){ background-color: blue; }
//触摸 tr:hover { background-color: black; } //点击 tr:active { background-color: red; } #tab { width: 800px; height: 100px; } </style> </head> <body> <table border="1" id="tab" cellspacing="0" > <tr> <th></th> <th></th> <th></th> <th></th> </tr> <tr> <th></th> <th></th> <th></th> <th></th> </tr> <tr> <th></th> <th></th> <th></th> <th></th> </tr> <tr> <th></th> <th></th> <th></th> <th></th> </tr> </table> </body> </html>
颜色将就将就
标签:换色,color,tr,nth,隔行,background,child 来源: https://www.cnblogs.com/wuhuihui/p/15956697.html