how to centre div html code example
Example 1: div align center
.center {
text-align: center;
}
// or
<div style="text-align:center">
</div>
Example 2: how to center a div
.container {
...
display: flex;
justify-content: center;
}
.center {
text-align: center;
}
// or
<div style="text-align:center">
</div>
.container {
...
display: flex;
justify-content: center;
}