错误修正:IE双边距浮动错误
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了错误修正:IE双边距浮动错误相关的知识,希望对你有一定的参考价值。
It’s an Internet Explorer-exclusive bug wherein an element that is floated – and given a margin in the same direction as the float – ends up with twice the specified margin size. The fix is extremely simple. All you have to do is apply a display: inline rule to your floated element.
/* Instead of this */ #content { float: left; width: 500px; padding: 10px 15px; margin-left: 20px; } /* Do this */ #content { float: left; width: 500px; padding: 10px 15px; margin-left: 20px; display:inline; }
以上是关于错误修正:IE双边距浮动错误的主要内容,如果未能解决你的问题,请参考以下文章