table元素的td和ul元素li隔行变色的功能实现

利用css控制二者的样式轻松实现隔行换色:

例如:table的css样式控制:

table tr td{

  background-color:颜色1

}

table tr td:nth-child(2n+1){

   background-color:颜色2

}


ul的li样式控制

ul li{

  background-color:颜色1;

}

ul li:nth-child(2n+1){

   background-color:颜色2;

}

 

相关文章:

  • 2021-07-20
  • 2022-12-23
  • 2021-09-11
  • 2021-10-20
  • 2022-12-23
  • 2021-08-04
  • 2022-01-29
猜你喜欢
  • 2021-12-07
  • 2022-12-23
  • 2021-12-14
  • 2021-08-08
  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
相关资源
相似解决方案