Align block to the center (flexbox 2)
https://habr.com/ru/post/238449
by Евгений Дзюба
HTML
<div class="parent">
<div class="block">
<div class="item">Котельня №1</div>
<div class="item">Кот №1</div>
<div class="item">Котел №1</div>
<div class="item">Котельня №1</div>
<div class="item">Котельня №1</div>
<div class="item">Котельня №1</div>
<div class="item">Котельня №1</div>
<div class="item">Котельня №1</div>
<div class="item">Котельня №1</div>
</div>
</div>
CSS
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
.parent {
width: 100%;
height: 100%;
position: fixed;
*top: 0;
* left: 0;
display: flex;
* overflow: auto;
background-color:grey;
}
.block {
margin: auto;
background: green;
display:flex;
flex-direction:row;
flex-wrap: wrap;
width: 60%;
justify-content:flex-start
}
.item {
border: none;
background: red;
*padding: 10px;
margin:10px;
width: 140px
}