To wrap an item using div
, just set display: flex;
and justify-content: center;
.
<div class="parent">
β¦
</div>
.parent {
display: flex;
justify-content: center;
}
If youβre using TailwindCSS, just add flex
and justify-center
classes:
<div class="flex justify-center">
β¦
</div>
or using Bootstrap, just add d-flex
and justify-content-center
classes:
<div class="d-flex justify-content-center">
β¦
</div>
Top comments (1)
add align-items: center; to make it center verticaly π