У меня есть страница, которая выглядит так:
<div>
<p> This text appears above the image</p>
<!-- I know the <div><p> construction is superfluous. I was just trying things out -->
</div>
<div style="display: block; width: 100%; clear: both;">
<img class="left" alt="Img1" src="img1.jpg" alt="" width="242" height="181" />
<img class="right" alt="Img2" src="img2.jpg" alt="" width="242" height="181" />
</div>
<div>
<p> This text appears between those images. I want it to display below them.</p>
</div>
У каждого изображения есть этот CSS:
.left {
float: left;
margin-right: 5px;
}
.right {
float: right;
margin-left: 5px;
}
Как я могу сделать так, чтобы эти два изображения плавали рядом друг с другом, но текст не переносился между этими изображениями?
ASCII искусство текущей страницы:
my text my text my text my textmy text
my text my text my textmy text my text
--------- text is wrapping ---------
| IMG | text is wrapping | IMG |
--------- text is wrapping ---------
my text my text my text my textmy text
my text my text my textmy text my text
Прекрасное ASCII искусство того, чего я желаю:
my text my text my text my textmy text
my text my text my textmy text my text
--------- ---------
| IMG | | IMG |
--------- ---------
text is wrapping text is wrapping text
is wrapping
my text my text my text my textmy text
my text my text my textmy text my text