我想在我的 html 网站上放置一些文本,其中有一个空格。
<div class="text">
text text
</div>
当我打开网站时,它没有显示为空格,而是在两个词之间换行。如何输入空格?
最佳答案
您可以使用 <br>
元素。
top stuff
<div class="text">
<br>
text text
<br>
<br>
more text
<div>
您可以阅读更多关于 <br>
的信息这里:https://developer.mozilla.org/en/docs/Web/HTML/Element/br
请注意,您需要两个 br 来分隔两行文本,一个相当于回车。无,将第二行放在第一行之上。
关于html - html文本中的新行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44161054/