Home > Web Front-end > CSS Tutorial > 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

高洛峰
Release: 2017-03-10 19:22:05
Original
2400 people have browsed it

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;
}
Copy after login


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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template