Home  >  Article  >  Web Front-end  >  Detailed explanation of the implementation of the interlaced color change function of table's td and ul elements li

Detailed explanation of the implementation of the interlaced color change function of table's td and ul elements li

高洛峰
高洛峰Original
2017-03-10 19:22:052368browse

This article explains in detail the implementation of the function of interlaced color change of td and ul elements li of table

The implementation of the function of interlaced color change of td and ul elements li of table element

Use css to control 2 Easily achieve interlaced color change using the author's style:

For example: table css style control:

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;
}


The above is the detailed content of Detailed explanation of the implementation of the interlaced color change function of table's td and ul elements li. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn