这是我的问题的演示。这在 Chrome 和 Firefox 中可以正常工作。但是,在 IE7 中,未清除的浮动元素最终会在容器顶部并排放置。 http://jsfiddle.net/eGAHx/
HTML:
<span class="bold floatLeft clearLeft">ISBN-13: </span>
<h2 class="floatLeft" itemprop="isbn">9780538735452</h2>
<span class="bold floatLeft clearLeft">ISBN: </span>
<h2 class="floatLeft">0538735457</h2>
<span class="bold floatLeft clearLeft">Edition: </span>
<span class="floatLeft" itemprop="bookEdition">3</span>
<span class="bold floatLeft clearLeft">Pub Date: </span>
<span class="floatLeft" itemprop="datePublished">2010</span>
<span class="bold floatLeft clearLeft">Publisher: </span>
<span class="floatLeft" itemprop="publisher">Brooks Cole</span>
CSS:
.floatLeft{float:left}
.bold{font-weight:bold}
.clearLeft{clear:left}
预期结果:
ISBN-13: 9780538735452
ISBN: 0538735457
版本: 3
出版日期: 2010
出版商: Brooks Cole
当前 IE7 结果:
ISBN-13: 9780538735452053873545732010BrooksCole
ISBN:
版本:
Pub Date:
Publisher: