0
I have the code below, it is working perfectly, the only problem is that if I add one more read or a few more it changes its formatting. I wish it was the same now, but no matter how many Lis there are. I would like the background to be the same as what is now in the example, but always regardless of the amount of li, if you want to test, just increase the li and you will see that the black background will change position.
ul {
margin-top: 30px;
width: 100%;
float: left;
}
li {
width: 50%;
float: left;
cursor: pointer;
}
li:nth-last-of-type(4n+1) {
color: #fff;
background: #000;
}
li:nth-last-of-type(4n+2) {
color: #fff;
background: #000;
}
<ul>
<li class="col-md-6 col-sm-6 col-xs-12" <h2>Caixa Econômica1</h2>
</li>
<li class="col-md-6 col-sm-6 col-xs-12" <h2>Caixa Econômica2</h2>
</li>
<li class="col-md-6 col-sm-6 col-xs-12" <h2>Caixa Econômica3</h2>
</li>
<li class="col-md-6 col-sm-6 col-xs-12" <h2>Caixa Econômica4</h2>
</li>
<li class="col-md-6 col-sm-6 col-xs-12" <h2>Caixa Econômica5</h2>
</li>
<li class="col-md-6 col-sm-6 col-xs-12" <h2>Caixa Econômica6</h2>
</li>
<li class="col-md-6 col-sm-6 col-xs-12" <h2>Caixa Econômica</h2>
</li>
<li class="col-md-6 col-sm-6 col-xs-12" <h2>Caixa Econômica</h2>
</li>
<li class="col-md-6 col-sm-6 col-xs-12" <h2>Caixa Econômica</h2>
</li>
<li class="col-md-6 col-sm-6 col-xs-12" <h2>Caixa Econômica</h2>
</li>
<li class="col-md-6 col-sm-6 col-xs-12" <h2>Caixa Econômica</h2>
</li>
<li class="col-md-6 col-sm-6 col-xs-12" <h2>Caixa Econômica</h2>
</li>
<li class="col-md-6 col-sm-6 col-xs-12" <h2>Caixa Econômica</h2>
</li>
<li class="col-md-6 col-sm-6 col-xs-12" <h2>Caixa Econômica</h2>
</li>
<li class="col-md-6 col-sm-6 col-xs-12" <h2>Caixa Econômica</h2>
</li>
<li class="col-md-6 col-sm-6 col-xs-12" <h2>Caixa Econômica</h2>
</li>
</ul>
How basic! !
– concas