I can't understend why the <span> element below has the height: 40px - how it was computed?
<span style="padding:10px; width:200px; height:30px; line-height:1; font-size:18px"></span>
I can't understend why the <span> element below has the height: 40px - how it was computed?
<span style="padding:10px; width:200px; height:30px; line-height:1; font-size:18px"></span>
Because of your height is ( exact height + padding + border ) , it's rule of box model . if you want the exact height only you should add this style to your css (box-sizing: border-box;).