简体   繁体   English

Firefox忽略为文本输入元素设置的百分比宽度值

[英]Firefox ignores percentage width value set for text input element

In the screenshots, the form text fields are set to 97% to create a gap between them. 在屏幕截图中,表单文本字段设置为97%,以在它们之间创建间隙。 It works in all browsers except Firefox -- it seems it stretches all the way to 100%. 它适用于除Firefox以外的所有浏览器-似乎可以一直扩展到100%。 Anyone pls give me a way to get around this? 有人请给我一种解决方法吗?

在此处输入图片说明

Try adding box-sizing: border-box (and the corresponding -moz-box-sizing , -webkit-box-sizing ). 尝试添加box-sizing: border-box (以及相应的-moz-box-sizing-webkit-box-sizing )。 Otherwise, padding and margin are added to the 97% instead of included in. 否则,将填充和边距添加到97%中而不是包含在其中。

I am using FF 13.0.1 on Mac OS and the gap shows correctly. 我在Mac OS上使用FF 13.0.1,间隙正确显示。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM