2
I’m using the line-height
to center a text vertically. But the text seems to me to have a small margin. Look at the image below, I selected the font to better see the spacing that’s making the difference in centering time.
You can fix that ?
#userNome{
width: 98%;
margin: auto;
margin-top: 50px;
margin-bottom: 20px;
line-height: 2;
text-align: center;
background-color: #FFF;
border-radius: 5px;
font-family: "Luckiest Guy";
color: #AF3846;
font-size: 26px;
&.show{
display: block;
}
}
<div id="userNome">Olá, Diego Souza</div>
I’ve used the
vertical-align
withdisplay:table
anddisplay:table-cell
, but it didn’t work. It stayed the same way. I think the source is like this...– Diego Souza
@Oeslei no need to specify unit of measure for line-height.
– user23124
@You’re right. I corrected the answer!
– Oeslei