如何把文字像使用CSS的报纸格式一样浮在图像周围? [英] How to put text float around image like some newspapers' format using CSS?
本文介绍了如何把文字像使用CSS的报纸格式一样浮在图像周围?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
< html>< p>
文字文字文字文字文字< br>
文字文字文字文字文字< br>
______________文字文字文字< br>
图片|文字文字文字< br>
图片|文字文字文字< br>
图片|文字文字文字< br>
___________ |文本文本文本(结束)
< / html>
我试过这个< DIV style =text-align:justify; text-justify:newspapers; padding:10px; font-size:1ุpx> text text text ....
但结果如下
______________< br>
图片|文字文字文字文字< br>
图片|文字文字文字文字< br>
图片|文字文字文字文字< br>
____________ |文字文字文字文字< br>
文本文本文本文本文本
文本文本文本文本文本文本(结束)
如果没有手动投放,我该怎么做? (比如先对齐文本,然后是图片和最终文本),因为我的网站上的所有图片和文本都将从数据库中提取。
在图像中使用Float propert并正常写文本
例如
< p为H.
一些文字一些文字一些文字一些文字一些文字一些文字一些文字一些文字一些文字一些文字一些文字一些文字一些文字一些文字
< img src =some.jpg风格= 浮动:左 >
一些文字一些文字一些文字一些文字一些文字一些文字一些文字一些文字一些文字一些文字一些文字一些文字一些文字一些文字
< / p>
I want my image wrapping with text align like this
<html>
text text text text text <br>
text text text text text <br>
______________ text text text <br>
image | text text text <br>
image | text text text <br>
image | text text text <br>
___________| text text text (end)
</html>
I've tried this < DIV style="text-align:justify; text-justify:newspapers; padding:10px; font-size:1ุpx" > text text text text ....
but the result comes like this
______________ <br>
image | text text text text<br>
image | text text text text<br>
image | text text text text<br>
____________| text text text text<br>
text text text text text text
text text text text text text (end)
What should I do without manual putting ? (like align text first , then image and final , text) because all images and texts of my website will be fetched from the database.
解决方案
use Float propert in image and write text normally
Eg
<p>
some text some text some text some text some text some text some text some text some text some text some text some text some text some text
<img src="some.jpg" style="float:left">
some text some text some text some text some text some text some text some text some text some text some text some text some text some text
</p>
这篇关于如何把文字像使用CSS的报纸格式一样浮在图像周围?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文