Align float in div

0

I am trying to align several div within one with float. Here is an example. My idea is to place several boxes not only 3.

.cont {margin: 0 auto; width: 720px;}
.thumm {
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
}

.thumm-box {
border: 1px solid #888;
display:inline-block;
width: 220px;
padding: 17px;
}
<div class="cont">
<p style="border: 1px solid #888;">linea</p>
<div class="thumm">

<div class="thumm-box">
thumm box 1
</div>

<div class="thumm-box">
thumm box 2
</div>

<div class="thumm-box">
thumm box 3
</div>
</div>
</div>
    
asked by Santiaggo 06.09.2018 в 03:02
source

1 answer

3

You can set the margin-right with a value of 2px:

.cont {margin: 0 auto; width: 720px;}
.thumm {
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
}

.thumm-box {
border: 1px solid #888;
display:inline-block;
width: 220px;
padding: 17px;
margin-right:2px;
}
<div class="cont">
<p style="border: 1px solid #888;">linea</p>
<div class="thumm">

<div class="thumm-box">
thumm box 1
</div>

<div class="thumm-box">
thumm box 2
</div>

<div class="thumm-box">
thumm box 3
</div>
<div class="thumm-box">
thumm box 4
</div>
<div class="thumm-box">
thumm box 5
</div>
</div>
</div>
    
answered by 06.09.2018 / 03:42
source