Ritika Agrawal• 170
@Ritika-Agrawal811
Posted
Hey! great work on the challenge!
Flex can be confusing to understand so I would like to suggest few points looking at your code:
- when using flex, if we want to center align a child vertically we need to add a height to the parent. In the "box" class, I think
align-items
andjustify-content
are used to center the "container" so just add a min-height/height of 100vh.
.box{
margin-top: 70px;
display: flex;
align-items: center;
justify-content: center;
height: 100vh: /* just add a height */
}
- Because you added
align-items: center
to "container", you don't have to add left and right padding to h1 and p tags. They would already be in center.
Also I think you have accidently deleted the image from your repo. Keep coding!
Marked as helpful
0