Answer the question
In order to leave comments, you need to log in
News output with two different wordpress styles?
In general, I plan to display news in two different styles, that is:
News 1 has the content-section-a
class News 2 has the content-section-b
class News 3 has the content-section-a
class News 4 has the content-section-b class
And so further around the circle. I can’t figure out how to implement this, and even xs from which side to approach Google, can someone tell me?
Answer the question
In order to leave comments, you need to log in
you just need the css property nth-child()
Let's say we have news displayed like this
<div class="items">
<div class="item">Новость 1</div>
<div class="item">Новость 2</div>
<div class="item">Новость 3</div>
<div class="item">Новость 4</div>
<div class="item">Новость 5</div>
</div>
.items .item:nth-child(1){
color:red;//перечисляем свойства
}
.items .item:nth-child(3){
color:blue;//перечисляем свойства
}
.items .item:nth-child(2n){
color:blue;//перечисляем свойства
}
$a % $b Modulo The integer remainder of $a divided by $b.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question