- 如何在图片浮动时不让文字内容环绕到图片下方
- 用背景图的方式实现在图片浮动时不让文字内容环绕到图片下方
类似左侧图片右侧文字的排版方式我们经常能够见到,但是,有许多网友都遇到过一个问题:在图片浮动到一侧时,超出图片高度的文字往往会环绕到图片的下方。
ghettocooler.net 的解决方案:
--------------------------------------------------------------
点此浏览示例文件
--------------------------------------------------------------
CSS:
<style type="text/css"> .callout { border:1px solid #000; float:left; width:275px; } .callout h3 { width:115px; height:65px; float:left; text-indent:-8008px; background:transparent url(team-report.gif) no-repeat 0 0; } .callout * { width:160px; float:right; } .callout * * { width:auto; float:none; } </style>
HTML:
<div class="callout"> <h3>team report graphic, replaced image</h3> <h2>Team Report 10-06-05</h2> <ul> <li>An <a href="#">anchor tag</a> perhaps?</li> <li>Or a <strong>strong tag</strong> perhaps?</li> </ul> <p>Here's a paragraph too!</p> </div>
原文请浏览:
http://www.ghettocooler.net/2005/11/13/image-floats-without-the-text-wrap/


