0
How can I make the squares stay in one line, generating one scroll horizontal, where I can navigate to the other blocks by sliding left or right.
.box{
width: 100px;
height: 100px;
display: inline-block;
}
.box:nth-child(1) { background: red; }
.box:nth-child(2) { background: orangered; }
.box:nth-child(3) { background: purple; }
.box:nth-child(4) { background: yellow; }
.box:nth-child(5) { background: green; }
.box:nth-child(6) { background: black; }
.box:nth-child(7) { background: orange; }
.box:nth-child(8) { background: orangered; }
.box:nth-child(9) { background: purple; }
.box:nth-child(10) { background: yellow; }
.box:nth-child(11) { background: red; }
<div class=itens>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
</div>
this needs to be done in div with the style "items". if adding a display should work:
.itens{ display: inline-flex;}
– Ricardo Pontual