Archive for December, 2008

IE6 double margin bug

by on Dec.16, 2008, under webdev

在IE5和IE5.5上同样能重现的bug:一个元素float的方向同margin的方向相同的情况下,margin会加倍。

如以下元素:

<div class=”left” />

.left

{

float: left;

margin-left: 10px;

}

在IE6下,这个margin其实会占据20px。

其中几种解决方案:

  1. 用”display:inline”的style: 元素float后,display属性随之无效;
  2. 换用父级padding;
  3. CSS hack:不推荐,不告知。
Leave a Comment : more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

Archives

All entries, chronologically...