使用缩进和对齐在图像周围环绕文本
问题描述:
我想做这样的事
问题是,我需要 p
有一个缩进和对齐方式。
我可以将图像向左浮动,然后将 h3
和 p
的显示设置为inline,然后我无法设置缩进,更重要的是使文本对齐。
任何人都有任何想法如何解决这个问题?谢谢!
The problem is that I need the p
to have an indentation and justify as alignment.
I could float the image to the left and then set the display of h3
and p
to inline but then I am unable to set an indentation and more importantly to make the text justify.
Anyone have any ideas how to solve this? Thanks!
答
img {
float: left;
margin: 0 20px 20px 0;
}
p {
text-align: justify;
text-indent: 2em;
}
这里是小提琴:http://jsfiddle.net/9VkQR/