In your last question I believe the differences in the application of line-height
will depend a lot on the rest of your layout. Here's an example:
ul#lista1{
line-height: 40px;
}
ul#lista2 li{
line-height: 40px;
}
<ul id="lista1">
<li><a>Nomes</a></li>
<li><a>Nomes</a></li>
<li><a>Nomes</a></li>
</ul>
<hr>
<ul id="lista2">
<li><a>Nomes</a></li>
<li><a>Nomes</a></li>
<li><a>Nomes</a></li>
</ul>
You may notice that there are no differences in relation to your application. And this repeats even when there is a line break.
Already, when <a>
creates that application is not necessary in it, if it is in the model above, within li
. If it is out, we could already consider this assignment.
When I want to center a text vertically, (when using line-height), I assign it a value equal to the height of the parent element.
Another formula I found is, when we are not aware of the element size, we use this:
That'sright!Multiplythe
font-size
bythenumberofgold,thephi.
Insometestsitworkedperfectly:
ul,li{
margin: 5px 0;
padding: 0;
}
ul#lista1{
line-height: 40px;
}
ul#lista2 li{
font-size: 20px;
line-height: 32.36px;
background: gold
}
<ul id="lista1">
<li>Nomes </li>
<li>Nomes</li>
<li>Nomes</li>
</ul>
<hr>
<ul id="lista2">
<li>Nomes</li>
<li>Nomes</li>
<li>Nomes</li>
<li>Nomes</li>
</ul>
The above example is a broad view of your formula.
But again, this is all very relative, I just hope it helped. And I agree with Gilherme Lopes, take a look at illustrator css exports, it might really help.