【发布时间】:2015-09-20 01:31:52
【问题描述】:
我正在建立一个网站,并在 div 的右侧浮动了一个图像,左侧有一些文本,我以前做过很多次。但是由于某种原因,图像在 FF 中并没有完全向右浮动,而是在 Chrome 和 IE/Edge 中。这可能很明显,但有什么见解吗?
火狐
Chrome/IE
HTML
<div class="wrapper">
<img src="http://www.chriswickham.co.uk/gohard/img/workouts/hammer_curl.png" height="85%" style="float:right;padding-left:40px"/>
<h1>Hammer Curl</h1>
<h2>Arms</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer dignissim ut mauris in vehicula. Suspendisse sodales nec quam in convallis. In quis ante eros. Pellentesque id lacus et massa tempor hendrerit.</p>
<div style="clear:both"></div>
</div>
CSS
.wrapper {
margin: 0px auto;
width: 1000px;
padding: 20px 0px;
}
【问题讨论】:
-
您的代码在 Firefox 和 Chrome 上的呈现方式相同。请参阅:How to create a Minimal, Complete, and Verifiable example。