It takes the width of the parent element and sets the width of the current element to 100% of it.
What you may have run into, however, is the IE box model bug (which is still present in 'Quirks Mode').
Specifically, when in quirks mode, IE includes padding within the area defined by 'width', while the W3C box model does not - both padding and margin are added onto the width.
发布评论
评论(2)
它获取父元素的宽度并将当前元素的宽度设置为其 100%。
然而,您可能遇到的是 IE 盒模型错误(该错误仍然存在)在“怪癖模式”中)。
具体来说,当处于怪异模式时,IE 在“宽度”定义的区域内包含填充,而 W3C 盒模型则不然 - 填充和边距都添加到宽度上。
It takes the width of the parent element and sets the width of the current element to 100% of it.
What you may have run into, however, is the IE box model bug (which is still present in 'Quirks Mode').
Specifically, when in quirks mode, IE includes padding within the area defined by 'width', while the W3C box model does not - both padding and margin are added onto the width.
您可以参考此页面了解更多详细信息。
You can refer to THIS page for more detailed information.