Kapil• 40
@KAPIL9027
Submitted
Centering the card both vertically and horizontally was a bit difficult to do but did it with flex anyway. Is there any other way of doing it?
@MrinmoyHaloi
@KAPIL9027
Submitted
Centering the card both vertically and horizontally was a bit difficult to do but did it with flex anyway. Is there any other way of doing it?
@MrinmoyHaloi
Posted
Flex is a great way of centering things. But you can also do it using grid. You can use the following snippet. It takes only two lines. Shorter then flex. I prefer to center things this way.
display: grid;
place-items: center;