<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構造があります。
今のところ、背景が異なる行を交互に提供したいと考えています。色をつけたい要素はclass=text
CSSで次のことを行います-
.tweet-inner .tweet .text-wrapper .text:nth-child(even) {
background-color: #FF0000;
}
これは機能しません、私も試しました-
.text:nth-child(even) {
background-color: #FF0000;
}
これが機能するものです-
article.text:nth-child(even) {
background-color: #FF0000;
}
.text
しかし、記事全体ではなく、交互に色を付けたい. これも機能しません。
フィドルはhttp://jsfiddle.net/LKqvz/です。私にお知らせください。