iPhone< button>填充不变? [英] iPhone <button> padding unchangeable?

查看:99
本文介绍了iPhone< button>填充不变?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Mobile Safari中的HTML5 < button> 似乎具有固定的,不可更改的左右填充。 这里是演示,以及它在Safari 5和iOS4中的外观。

A HTML5 <button> in Mobile Safari seems to have fixed, unchangeable left and right padding. Here's a demo plus how it looks in Safari 5 and iOS4.

如何摆脱这个填充?

推荐答案

只是想出了附加填充总是1em。如果你使用绝对数字的字体大小,你可以将按钮的字体大小设置为0,并重置它的内部元素:

I just figured out that the "additional padding" is always 1em. In case you use an absolute number for your font-size, you can set the button's font-size to 0 and reset it for the inner element:

button{
   font-size:0;
}
button span{
   font-size:14px;
}

<button><span>Submit</span></button>

这篇关于iPhone&lt; button&gt;填充不变?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆