使用缩进和对齐在图像周围环绕文本 [英] Wrapping text around an image with indentation and justify

查看:111
本文介绍了使用缩进和对齐在图像周围环绕文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想做这样的事


问题是,我需要 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/

这篇关于使用缩进和对齐在图像周围环绕文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆