开发者

Firefox buttons have padding, Chrome buttons do not

How do I get my <button>s to look consistent in Firefox and Chrome? Is there a non-conditional CSS solution? Right now, Firefox's buttons have extra padding even though YUI's CSS Reset made the padding 0.

Firefox buttons have padding, Chrome buttons do not

I discovered that to get the same appearance, Chrome needs to have double the padding.

            #fileActions button {
                padding: 0.2em;
            }

@media screen and (-webkit-min-device-pixel-ratio:0) {
            #fileActions button {
                padding: 0.4em;
            }
}

Chrome

Firefox buttons have padding, Chrome buttons do not

Firefox

Firefox buttons have padding, Chrome buttons do not

开发者_StackOverflow


Firefox gives buttons something called inner focus, this allows it to draw the dotted focus line. There is a rule in forms.css for it, which gives it 1px of border and 2px of left and right padding. I don't know whether it's possible to override this from a web page.


It´s hard to say without seeing your css, but if you check the css of the YUI reset, you will see that it does not set or reset any properties for the button element except for the inherited ones and that does not include padding as far as I know.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜