W3School says :
When we use
vertical-align:middle;
The element is placed in the middle of the parent element
So I tried to do that, But didn't get desired outcome
CODE :
div {
height: 200px;
width: 500px;
background: red;
text-align: center;
vertical-align: middle;
}
p {
vertical-align: middle;
}
<div>
text
<p>
yo bro
</p>
</div>
Why m I not getting the desired outcome ?
line-height: 200px
to your div and you'll see. – Paulvertical-align
does not behave like that. – Oriol