如何使用CSS讓文字環繞圖片(最多3面環繞)


HTML和CSS代碼如下:

<html>
<head>
<style type="text/css">
img 
{
float:right;
clear:both;
}
</style>
</head>

<body>
<p>在下面的段落中,我們添加了一個樣式為 <b>float:right</b> 的圖像。結果是這個圖像會浮動到段落的右側。</p>

<div style="width:0px;height:20px;float:right"></div>
<img src="/i/eg_cute.gif" />
<p>
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
</p>
</body>

</html>  

 

效果如下:

測試地址:

http://www.w3school.com.cn/tiy/t.asp?f=csse_float

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM