Html 中断空间(与非中断空间相反)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38661784/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 13:39:09  来源:igfitidea点击:

Breaking space (Opposite of non-breaking space)

htmlhtml-entities

提问by Sander Koedood

While solving a little bug in a website caused by a non-breaking space (  ) I was wondering if there's an opposite.

在解决由不间断空格 (  )引起的网站中的一个小错误时,我想知道是否存在相反的情况。

Is there a HTML-code for a breaking space, and if so, what is it?

是否有用于中断空间的 HTML 代码,如果有,它是什么?

I saw mention in this questionabout a zero-width space ( ​), but that won't give any width (obviously).

我在这个问题中看到了关于零宽度空间 ( ​) 的提及,但这不会给出任何宽度(显然)。

Does a HTML-entity exist for a regular space?

常规空间是否存在 HTML 实体?

回答by Bert

 is a regular space (by its numeric ascii value).

 是一个常规空间(通过它的数字 ascii 值)。

回答by Case

If you are using HTML and you would like more then 1 space to to appear, will not work. The unfortunate part about   is it does not wrap properly because it is a non-breaking space.

如果您正在使用 HTML 并且您希望显示多于 1 个空格,则行不通。不幸的部分是它没有正确包装,因为它是一个不间断的空间。

For those that reached here looking for a solution, try the CSS

对于那些到达这里寻找解决方案的人,请尝试使用 CSS

white-space: pre-wrap;

white-space: pre-wrap;

This will allow you to have multiple spaces side by side in a single line. Works great for chat programs.

这将允许您在一行中并排放置多个空格。非常适合聊天程序。

回答by Utibe

To insert a breaking space use <br>, It will insert a breaking space in the html document.

要插入一个换行符,使用<br>,它将在 html 文档中插入一个换行符。