I am trying to hide the first 3 elements having the class .row
inside the block .container
.
What I'm doing is hiding all the .row
first, and then I am trying to display the first 3 .row
by using .row:nth-child(-n+3)
jsfiddle here: http://jsfiddle.net/z8fMr/1/
.row {
display: none;
}
.row:nth-child(-n+3) {
display: block;
}
<div class="content">
<div class="notarow">I'm not a row and I must remain visible</div>
<div class="row">Row 1</div>
<div class="row">Row 2</div>
<div class="row">Row 3</div>
<div class="row">Row 4</div>
<div class="row">Row 5</div>
<div class="row">Row 6</div>
</div>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…