Reputation: 59
I have a problem with changing the line-height of a child element. My goal is just to reset line-height to normal value instead of using the higher value of its parent.
a{ line-height:100px; }
a small{ line-height:10px; //or normal }
So I want the line-height of small
to normal but it doesn't work.
Any ideas?
Upvotes: 5
Views: 3654
Reputation: 1408
Here is the updated fiddle
i just added display:inline-block
.first small{
line-height:normal;
display: inline-block;
}
Upvotes: 2
Reputation: 7673
Use:
small {
display: inline-block;
line-height: 1; /*or whatever you like.*/
}
You need inline-block
, as <small>
is inline by default, and so inherits its parent's line height.
Upvotes: 15