<article class="tweet-inner">
<div class="text-wrapper">
<div class="tweet">
<div class="text">
<p>Coming down! Time for Croation BBQ </p>
</div>
<p class="last">
<span class="pull-right">
<small> Hello this is first text </small>
<small> Hello this is second text </small>
</span>
</p>
</div>
</div>
</article>
다음과 같은 html 구조가 반복됩니다.CSS를 통해 반복되는 HTML 구조체 div의 색상이 번갈아 표시됩니다.
현재로서는 다른 배경을 가진 대체 행을 제공하고 싶습니다.
.text:nth-child(even) {
background-color: #FF0000;
}
이 작동하는 것입니다 - -이 작동하지 않습니다
.tweet-inner .tweet .text-wrapper .text:nth-child(even) {
background-color: #FF0000;
}
, 나는 또한 시도 - 나는 색상을 원하는 요소 내가 내 CSS에서 다음을 수행 class=text
입니다
article.text:nth-child(even) {
background-color: #FF0000;
}
하지만 .text
은 e가 아니라 번갈아 가며 색칠하고 싶습니다. 기사. 이 또한 작동하지 않습니다.
바이올린은 http://jsfiddle.net/LKqvz/입니다. 저에게 알려주세요.