This question already has an answer here:
I've only just realised that anchor tags with a background will only inherit their line-height and you can only set it directly by setting the anchor to display: inline-block;
Why is this?
http://jsfiddle.net/moefinley/3H3y5/
ul li a {
display: inline-block;
line-height: 20px;
}
Here is root cause :
The following behaviors fall out of this description:
So your line-height for
a
with background works fine only when you mark it as block element usinginline-block
. And with default behavior it will just stretch the line height without stretching background.