Skip navigation.

踩 IE

I hate IE forever.

IE一个极其愚蠢的宽度计算BUG

当你想使用一个3列均为相对宽度,总宽度为100%的流动布局时,请注意,IE也许会给你开一个大玩笑,看下面的代码:
<style type="text/css">* {
margin:0;
padding:0;
}
.div1 {
float:left;
width:15%;
background:red;
}
.div2 {
float:left;
width:70%;
background:#00FFCC;
}
</style>
<div class="div1">此处显示  class "div1" 的内容</div>
<div class="div2">此处显示  class "div2" 的内容</div>
<div class="div1">此处显示  class "div1" 的内容</div>


请把分辨率调至1024*768,然后打开IE最大化窗口后看这段代码的显示效果。
不出意外的话,第三列应该跑到下面去了。如果拖动窗口改变窗口大小的话,会看到3列有时可以并列有时不可以,显然这是IE的宽度计算不够精确导致的。

结论:I hate IE forver.

今天算是切实地感受到了Google对Opera的轻视...很实用的DHTML网站

Comments

Anonymous 22. May 2006, 01:42

xmlhtml.com.cn writes:

是啊,看来微软不太重视这个捆绑的软件。

Anonymous 31. May 2006, 15:26

Anonymous writes:

恨死IE了,可能也是因为这个毛病,在我的一个设计中,本来拼接很好的背景图,在调整窗口宽度的时候就有条缝隙一隐一现的,恶心死了。

qicai02 9. June 2006, 02:10

哎呀,这是常见的现象啊!

musiccow 14. June 2006, 14:15

我以前尝试写网页时也碰过这种问题啊,头疼得不得了

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies

December 2009
S M T W T F S
November 2009January 2010
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31