如果你这样写:
一个
_
它通常会呈现为“a b”。我希望它呈现为“ab”。有什么想法吗?
If there is one character deemed to be white space (either a tab, space or line break) then a space will be added. You can use javascript to remove the spaces but it's not suggested. What ever is printing it out should be taking care of that for you.
What platform are you using, we may be able to help better if we knew the circumstances.
You could add a comment:
a<!--
-->b
这与空格折叠无关,因为字符之间只有一个换行符。折叠是将多个连续的空白视为一个空格。
HTML 中没有办法说在忽略换行符的意义上不应用正常的 HTML 空白规则。
在 CSS 中,您可以设置 eg word-spacing: -0.25em
,但这0.25em
只是空间宽度的粗略近似值。
要使“a”和“b”之间没有空格,请将它们写为“ab”。