css - IE11 中的最大宽度问题

标签 css html twitter-bootstrap internet-explorer-11

我正在尝试使用一些 Bootstrap 类在我的表单中的必填字段中添加左塞子。

<div class="input-group input-group-sm">
     <span class="input-group-addon label-danger" style="max-width:10px;"></span>
     <input id="Name"maxlength="30"/>
</div>

这给了我在除 IE11 之外的所有浏览器中查看的显示。在 IE11 中,宽度保持不变,就好像我没有添加 max-width 属性一样。 这是所需的结果:

enter image description here

这是我在IE11中得到的(宽度不一样)

enter image description here

最佳答案

尝试将其添加到您的样式表中。

html {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
*,
*:before,
*:after {
  -webkit-box-sizing: inherit;
  -moz-box-sizing: inherit;
  box-sizing: inherit;
}

关于css - IE11 中的最大宽度问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30863957/

相关文章:

javascript - ng-repeat 和 ng-class 的 Angular 模板指令

html - 展开动态背景

css - 带有 Bootstrap 的 Meteor margin-bottom

javascript - 使用 AngularJS 提交 Bootstrap 表单时显示进度(圆圈)

css - 在 Wordpress 中更改 html 结构和创建菜单项

css - 如何在属性选择器中使用/模拟类似正则表达式的反向引用?

html - 在特定字符处断词

html - 文本溢出 : ellipsis; in table cell

html - 当我缩小窗口时,如何使我的背景图像不变小?

css - Rails Simple Form CSS - 输入元素之间的空间