通过css对重复html结构的div进行交替着色
这不起作用,我也试过-通过css对重复html结构的div进行交替着色,css,Css,这不起作用,我也试过- .tweet-inner .tweet .text-wrapper .text:nth-child(even) { background-color: #FF0000; } 这是有效的- .text:nth-child(even) { background-color: #FF0000; } 但是我希望.text交替着色,而不是整篇文章。 这也不起作用 这把小提琴很好。请让我知道 应该是: article.text:nth-child(even) {
.tweet-inner .tweet .text-wrapper .text:nth-child(even) {
background-color: #FF0000;
}
这是有效的-
.text:nth-child(even) {
background-color: #FF0000;
}
但是我希望.text
交替着色,而不是整篇文章。
这也不起作用
这把小提琴很好。请让我知道 应该是:
article.text:nth-child(even) {
background-color: #FF0000;
}
因为您有多个文章
元素和一个.text
DIV(您尝试从文章
中选择第n个.text
子元素)试试这个
article:nth-child(even) .text{
...
}
试试这个:
article:nth-child(even) .text {
background-color: red;
}
article:nth-child(even) .text {
background-color: red;
}
article:nth-child(even) .tweet .text {
background-color: #FF0000;
}