Jan
19
IE6下width:100%的BUG
Mark一个今天遇到的问题:
<div class=”page_wrapper”>
<div style=”margin:30px;” class=”table_wrapper”>
<table width=”100%”>数据</table>
</div>
</div>
这样的结构的时候在Ie6中的table会错误的把page_wrapper当作100%的参考对象,于是会把table_wrapper撑破(比预想效果多60px宽度)。
解决方法就是给table_wrapper加上 width:100% 就ok了
3 Responses
This is not a bug,it is just your fault.
width=”100%”
这句话实际上等同于
width=”显示器分辨率宽度”;
实际看来,假设我显示器分辨率为 1024 x 768
那么
就是
了。
加上
这里的margin属性,那么这个层地宽度就是768+30+30 = 828px
比显示器的分辨率多了60px
% is defines the width in % of the parent element’s width
Leave a Reply