.btn-mini icon alignment issue in Firefox
I'm not necessarily looking for this to be fixed in Bootstrap because, admittedly, it's incredibly minor, but I'm hoping someone can help me shed some light on an issue that's driving me up the wall.
I'm testing out 2.1.0-wip on a new site I'm building and I've noticed that when I use the btn-mini class with icons inside it, the alignment is off (by a pixel or two) in Firefox, but perfect in IE 9 and Chrome. If I tweak the btn-mini font size or line height, it fixes it in Firefox, but then Chrome and IE are off. Here is a screenshot of what I'm seeing. (The third image is actually the Bootstrap docs but I've added the btn-mini class to a few buttons with the same result in Firefox.)
http://prntscr.com/dq2wu
Now for the weird part. If I plug the Bootstrap stylesheet in and create a jsFiddle, it works perfectly in Firefox. But the minute I put it into a page, it breaks. I'm using only Bootstrap styles at the moment, so I know it isn't something I've done in my own stylesheets. It's driving me crazy and I'm hoping someone can point me in the right direction on what I need to do to fix this alignment issue.
Difficult to help with the info you gave. Can you please provide the a link to your source code or link to your page? Basically anything that can help reproduce the problem you are having.
I pulled the latest docs from the 2.1.0-wip branch and threw it up on a server. I edited the base-css page to show the issue. I get the alignment issues in Chrome for Mac and Firefox for Win7. I've been poking at it for a couple days now but can't seem to find the right combination to get everything to align right.
Again, the issue is that icons inside mini buttons are aligned lower than they should be. Text seems to be fine. Just looking to see if anyone can help push me in the right direction to fix this.
http://dev.anodyne-productions.com/bootstrap/base-css.html
In the CSS,
.btn-group > .btn-mini {
font-size: 11px;
}
Since icons are of width and height 14px, they seem to show up a bit lower. Try changing the font-size to 14px. Should work then.
I don't know of a direct way to get this to work. Maybe the icons weren't designed to be put into btn-mini. Might be best to use btn itself.
Yeah, I tried that early on, but obviously makes any text in mini buttons way bigger than it should be. The real problem is that CSS can't ascend so I can't target mini buttons that have icons in them. I think at this point jQuery is the only solution:
$('.btn-mini:has(i)').css('font-size', '14px');
Thanks for the help though!
You can give an extra class to those mini buttons specifically for the ones which have an icon (say, .btn-icon). Specifying the class after the bootstrap CSS would help override the font-size property. Just in case you need a JS free solution. HTH.
Ha, can't believe didn't think of that. JS-free is definitely better, so that's definitely the way I'll go. Thanks!