There are blocks in which only neighbors (previous and next) of the block with the class .active
should be colored red (does not apply to blocks with active
!), And all the others to green; at the same time, the number of all blocks may be greater, including active ones, but the latter always go together one after the other and not always in the center. How can I do that? Fidl Conditions: html
can not be touched. Ideally, I would like to do without the scripts, but if there is no way without them, then I would like to know that option
.owl-item { background-color: green; height: 50px; width: 50px; display: inline-block; } .owl-item.active + .owl-item { background-color: red; }
<div class="owl-item">first</div> <div class="owl-item active">second</div> <div class="owl-item active">third</div> <div class="owl-item">fourth</div>
.active
, which ones should be painted? - lexxlactive
blocks themselves - Vasyacss
, it will be cool! - Vasya