Hassia Issah• 50,670
@Hassiai
Posted
To center .card on the page using grid, add place-items: center; to the body. there is no need for justify-content: center; and align-items: center; these are only use when centering with flexbox.
to center . card on the page using grid:
body{
display: grid;
place-items: center;
min-height: 100vh;
}
To center .card on the page using flexbox:
body{
min-height:100vh;
display: flex;
align-items: center;
justify-content: center;
}
Use relative units like rem and em as the unit for the widths, paddings, margin and font-size values. For more on CSS unit click here
Hope am helpful.
Well done for completing this challenge. HAPPY CODING
Marked as helpful
0