gpt4 book ai didi

html - 文本对齐证明不起作用

转载 作者:技术小花猫 更新时间:2023-10-29 11:44:56 25 4
gpt4 key购买 nike

我正在尝试调整此 p 标签中的文本,使其完全适合 p 的宽度。

<p align="justify" style="text-align: justify !important; color:#fff; margin:0px; font-weight:bold; width:487px; border:Solid 1px red;">blah blah blah</p>

但是文本只是不合理!知道为什么吗?

感谢您的帮助。

最佳答案

您可以使用此处描述的解决方案: http://blog.vjeux.com/2011/css/css-one-line-justify.html

这将对齐单行但在其后添加一个空格,因此如果您知道高度,您可以使用 overflow:hidden 指定它以隐藏它并仍然得到对齐。

.fulljustify {
text-align:justify;
}
.fulljustify:after {
content: "";
display: inline-block;
width: 100%;
}
#tagline {
height: 80px;
overflow: hidden;
line-height: 80px; /* vert-center */
}
<p id="tagline" class="fulljustify">Blah blah blah</p>

关于html - 文本对齐证明不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6228347/

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