我正在使用 Bootstrap 并且我有这些行:
<div class="col-lg-2">
<div class="input-group">
<span class="input-group-addon" style="max-width:70px">Serial Number</span>
<input type="text" class="form-control" data-bind="value:DeviceSerialNumber" required />
</div>
</div>
如您所见,我想覆盖 input-group-addon
的 Bootstrap 默认最大宽度。
在 chrome 中它工作正常,这个插件只有 70px 宽。但在 FF 和 IE 中不是。
你能告诉我为什么它只适用于 chrome 吗?
最佳答案
max-width
仅适用于与为同一元素设置的 width
相关的情况,因此 - 除非您明确设置了 width
, max-width
无法计算,因此仍未定义。
The max-width CSS property is used to set the maximum width of a given element. It prevents the used value of the width property from becoming larger than the value specified for max-width.
关于html - IE 和 Firefox 忽略最大宽度样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23760980/