Reputation: 32240
For some reason Firefox button
elements don't seem to respect the CSS padding
declarations, even if you make them display: block
.
See this JSFiddle in Chrome and Firefox: http://jsfiddle.net/DgeQ6/
Notice how the padding works in Chrome but not in Firefox. How do I get Firefox to pay attention to padding
in button
elements?
Here's a screenshot of how it looks on Firefox on my machine:
The padding should be 20px but it's not affected.
Upvotes: 1
Views: 242
Reputation: 35064
Padding by itself doesn't work on Mac because the Mac native-themed look for buttons overrides the padding. On Windows it works just fine, for example. I can't recall what the behavior is on Linux offhand.
The safest way to deal with this is to set -moz-appearance: none
if you want to drop the native-themed look.
Upvotes: 2
Reputation: 273
Credit should go to Boris below but you need to use -moz-appearance:none to override the OS level button stylings. Here's a fiddle: http://jsfiddle.net/DgeQ6/8/.
HTML
<button class="btn-large">Hello</button>
CSS
.btn-large {
padding: 100px;
-moz-appearance: none;
}
It should also be noted that Twitter Bootstrap appears to achieve the same effect for their buttons in Firefox just by having a "border-radius" styling along with padding.
Upvotes: 4