Reputation: 1656
I'm using twitter bootstrap to create a button group. When I changed font size of smaller class to 12px (14px by default), the height of the left button grows 1px. How can I avoid it? Checked by Chrome 26, Firefox 20.
<div class="btn-group">
<button class="btn">
Foo
<div class="smaller" style="font-size: 12px;">
Smaller
</div>
</button>
<button class="btn">
Bar
</button>
</div>
Example is available at http://jsfiddle.net/kawachi/xkP9j/
Upvotes: 1
Views: 324
Reputation: 11148
The problem is the line height. You need to either remove the line-height
attribute from .btn
or you need to add it to div.smaller
to match the font-size
Upvotes: 1
Reputation: 27405
set the line-height
also
<div class="smaller" style="font-size: 12px;line-height: 12px;">
Smaller
</div>
Upvotes: 1