对齐段落文本HTML [英] Justify Paragraph Text HTML

查看:80
本文介绍了对齐段落文本HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何证明这个文本是正当的?
我试过搜索了几天,得到这么简单的工作..

How would one justify this text?? I have tried and searched for days to get something so simple to work..

例如:

HTML:

<div id="justify">
   <p>I just want this to justify..</p>
</div>

CSS:

#justify {
    width: 100%;
    background: #D33;
}

#justify p {
    margin: 0 auto;
    max-width: 70%;
    list-style: disc outside none;
    text-align: justify;
    display: list-item;
    background: #ccc;
    }

在JSFiddle上:

Here on JSFiddle:

http://jsfiddle.net/xDqwF/

任何帮助都将非常感激。

Any help would be much appreciated.

推荐答案

#justify p:after {
  content: "";
  display: inline-block;
  width: 100%;
}



通过一些HTML Trickery,这应该可以工作。我发现它在一个博客文章很久以前,当我有一个类似的问题。在JSFiddle上查看

Through some HTML Trickery, this should work. I found it on a blog post ages ago when I had a similar problem. Check it out on the JSFiddle

http://jsfiddle.net/xDqwF/ 2 /

这篇关于对齐段落文本HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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