The p
element is at the vertical center of the .align
element. This is not equal to being at the vertical center of the page. To make the p
element be at the vertical center of the page, the .align
element has to take up the whole height of the page. This could be done by applying height: 100vh
to the .align
element.
(If you want to horizontally center the p
element, you have to apply justify-content: center
to the .align
element.)
(If the .align
element is just for alignment, it could make sense to just remove it and simply apply
background: white;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
to the body
:)
body {
background: white;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
<p>This is filler text for a pretend blog </p>