I am trying to use grid layout in CSS to place three boxes in one div (container). There will be only one row. Box 1
will stay close to the left side, box3
close to the right side and box2
in the center. Also all boxes should be vertically in the middle.
this is my code but I cannot make it the way I described.
.statusBar{
border: 1px solid #999;
display: grid;
grid-template-columns: 50px 1fr 50px 1fr 50px;
grid-column-gap: auto;
}
.statusBar > div{
border: 1px solid #000;
}
<div class='statusBar'>
<div>1</div>
<div>2</div>
<div>3</div>
</div>
It is better if the size of each small box is on auto-fill and a the boxes should not stick to the edges. For example 10px space.
How can I make it work?