2015-06-16 45 views
6

我想在我的窗体中使用一些引导类在必填字段中添加左侧的塞子。在IE11中的最大宽度问题

<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中,宽度保持不变,就像我没有添加最大宽度属性一样。 这是必需的结果:

enter image description here

而这就是我得到了IE11(宽度是不一样的)

enter image description here

+0

您使用空元素作为左边距? – fcalderan

+0

是的,这是一个空的跨度 – AnotherGeek

+0

所以我可以问你为什么不简单地删除该跨度,并设置一个填充左边的父div? – fcalderan

回答

0

尝试增加给你的样式表。

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; 
 
}