Hassia Issah• 50,670
@Hassiai
Posted
To center the main on the page using flexbox or grid instead of giving the body a padding value.
- USING FLEXBOX: add min-height:100vh; display: flex; align-items: center: justify-content: center; to the body
body{
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
- USING GRID: add min-height:100vh; display: grid place-items: center to the body
body{
min-height: 100vh;
display: grid;
place-items: center;
}
Give .component a fixed max-width value. max-width:600px
.
Hope am helpful.
Well done for completing this challenge. HAPPY CODING
Marked as helpful
1