div align horizontal code example
Example 1: how to align elements horizontally in css
.row {
width: 100%;
display: flex;
flex-direction: row;
justify-content: center;
}
.block {
width: 100px;
}
Example 2: css align center vertical and horizontal
.parent-class {
display: flex;
align-items: center;
justify-content: space-around;
}
Example 3: how to get my div to centre
.div{margin: 0 auto;}
Example 4: how to align elements horizontally in css
<div class="row">
<div class="block">Lorem</div>
<div class="block">Ipsum</div>
<div class="block">Dolor</div>
</div>