gpt4 book ai didi

html - 对齐段落文本 HTML

转载 作者:太空狗 更新时间:2023-10-29 14:05:04 25 4
gpt4 key购买 nike

如何证明这段文字的合理性??我已经尝试并搜索了好几天才能找到如此简单易用的东西..

例如:

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 上:

http://jsfiddle.net/xDqwF/

如有任何帮助,我们将不胜感激。

最佳答案

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

通过一些 HTML 技巧,这应该可以工作。很久以前,当我遇到类似问题时,我在一篇博客文章中发现了它。在 JSFiddle 上查看

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

关于html - 对齐段落文本 HTML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21668120/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com