I would like to add a css for .st--player-box
, that even numbers had value float: right;
, and odd numbers had a float: left;
<div class="st--players-container">
<a href="#">
<div class="st--player-box">...</div>
</a>
<a href="#">
<div class="st--player-box">...</div>
</a>
<a href="#">
<div class="st--player-box">...</div>
</a>
<a href="#">
<div class="st--player-box">...</div>
</a>
</div>
I make a this code in CSS, but I don't know, why this is doesn't work.
.st--players-container .st--player-box {
display: block;
width: -webkit-calc(47%);
border: 1px solid #dadada;
box-sizing: border-box;
margin: 0 5px 10px 5px;
overflow: hidden;
}
.st--players-container .st--player-box:nth-child(odd) {
float: left;
}
.st--players-container .st--player-box:nth-child(even) {
float: right;
}