Bab*_*ker 5 html css firefox google-chrome css3
我有以下内容:
<div style="border:solid 1px gray; height:22px; line-height:22px; display:inline-block;">Div</div>
<input style="border:solid 1px gray; height:22px; line-height:22px; vertical-align:top;" type="text">
<button style="border:solid 1px gray; height:22px; line-height:22px; vertical-align:top;">Button</button>
Run Code Online (Sandbox Code Playgroud)
Dai*_*kai 10
它与浏览器实现这些元素的盒子模型的方式有关.
div
并且input
都使用content-box
where-as button
用途border-box
有关详细信息,请参阅此处:http://www.quirksmode.org/css/box.html
您可以添加box-sizing: content-box;
,-moz-box-sizing: content-box;
,-ms-box-sizing: content-box;
到CSS强制它使用计算维度的内容框方法.
编辑 - 更多信息:为什么Firefox使用IE框模型作为输入元素?
归档时间: |
|
查看次数: |
2903 次 |
最近记录: |