the <title>Property vertical-align.</title>
<style>
#container{
width: 400px;
height: 100px;
border: 1px solid black;
padding: 2px; /* Set the inner indentation */
margin: 0 auto; /* Rasmussen block center */
}
#container:before{
display: inline-block;
height: 100%;
vertical-align: middle;
content: "";
text-align: center;
}
p{
line-height: 50px;
font-size: 30px;
}
span{
display: inline-block;
vertical-align: bottom;
font-size: 10px;
}
</style>
<p>asdasdasdasdasdasdasd<span>Ressfsdfsdf</span>asdasdasd</p>
#container{
width: 400px;
height: 100px;
border: 1px solid black;
padding: 2px; /* Set the inner indentation */
margin: 0 auto; /* Rasmussen block center */
}
#container:before{
display: inline-block;
height: 100%;
vertical-align: middle;
content: "";
text-align: center;
}
p{
font-size: 30px;
}
span{
display: inline-block;
vertical-align: bottom;
font-size: 10px;
}
Find more questions by tags CSS
Aligns bottom of element and its descendants with the bottom of the entire row
Well I prescribe at p line-height: 50px; And I understand it must fall below. But I wrote get line-height: 50px; Maybe I do not understand? - Harrison_McLaughl commented on June 10th 19 at 15:24