【发布时间】:2020-07-29 19:37:04
【问题描述】:
我的代码:
<h1>example</h1>
<p align="justify">John’s family is living in a tiny flat. That would not be too bad. But unfortunately John is longing for a dog to play and fool arount with. There isn’t any space for a dog in the small attic. How can John’s dream come true? The little
mermaid is searching for <br /> a friend who is exactly like her. Unfortunately she cannot find an other mermaid in the ocean. So she has to stay all alone. Or is there any solution for this problem?
</p>
Result:
带有<br /> 标签的行的格式不正确。
重要的是,除最后一行之外的所有行都被格式化为 有道理。
单词之间的间隔大小并不重要。
换行符必须准确地保留在那里。
我尝试了 HTML 和 CSS。 我用谷歌搜索并在论坛中寻找类似的问题。 没有成功。
自行解决:
与:
text-align: justify;
text-align-last: justify;
在 CSS 中有效!!!
【问题讨论】:
-
似乎很奇怪它不是两个段落标签。
-
@epascarello - 就像一首诗。每个换行符都是有意义的。但是每个段落都应该被证明是合理的。 - 加上文本来自 mysql 通过 php 并且已经有换行符。
-
设置一个宽度,看看区别。
-
@Sam Herrmann - 这个问题/答案已经有将近 6 年的历史了,并且存在以下问题:“但是,如果段落的其余部分不适合一行,它将溢出您的宽度设置。”
-
来自副本:stackoverflow.com/a/63062369/8620333 ...问题的年龄无关紧要,有新的答案