gpt4 book ai didi

html - 空白 :pre-wrap not aligned on first line

转载 作者:行者123 更新时间:2023-11-28 04:45:36 24 4
gpt4 key购买 nike

我有以下html

<!DOCTYPE html>
<html>
<head>
<style>
p.test {
width: 11em;
border: 1px solid #000000;
word-wrap: break-word;
white-space: pre-wrap;
}
</style>
</head>
<body>
<p class="test"> This paragraph contains a very long word: thisisaveryveryveryveryveryverylongword. The long word will break and wrap to the next line.</p>
</body>

显示页面时,文本的第一行移动一个字母。 enter image description here

如果我更改为“white-space:pre-line”,显示器将不会显示空白。如何使第一行与其余文本对齐?

最佳答案

删除空格...

改变

<p class="test"> This

<p class="test">This

p.test {
width: 11em;
border: 1px solid #000000;
word-wrap: break-word;
white-space: pre-wrap;
}
<p class="test">This paragraph contains a very long word: thisisaveryveryveryveryveryverylongword. The long word will break and wrap to the next line.</p>

关于html - 空白 :pre-wrap not aligned on first line,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47438621/

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