@vladmee
Posted
Hi! Flexbox is great for this as already mentioned but I would like to give you an alternative, using grid:
display: grid;
place-items: center;
Grid feels more intuitive in this case as it's designed for arranging elements in a two-dimensional space, controlling layout both horizontally and vertically for complex structures.
Flexbox, on the other hand, is a one-dimensional model for aligning items in either a row or column. But it works if you think of the page as one big row where you position your item in the middle of the row, and align it vertically as well.Grid would be desired though!
@AaronNevalinz
Posted
@vladmee Sorry for the late reply. But all the same, thank you for that alternative. All my projects are based on Grid and flexbox.