开发者

"Input Submit" Cross-browser compatibility

<input type="submit" value="Share" />

In Chrome/Safari:

http://img514.imageshack.us/img514/619/btnwebkit.png

In FF:

http://img220.imageshack.us/img220/347开发者_运维百科/btnff.png

Can someone please tell me why they don't look the same?

Even, when I set the font-size, font-family, padding and margin, the button in FF will always look bigger than the one in Chrome/Safari.


This is because default styles on HTML elements like input buttons and H1 and UL and LI and so forth are subject to the browser developer's whim. You can minimize the disruption by using a reset stylesheet. That said, you may get better results by using <button type="submit" value="Share">Share</button> instead of an input (with a type of button), and setting the styles on that.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜