2

如果你这样写:

一个
_

它通常会呈现为“a b”。我希望它呈现为“ab”。有什么想法吗?

4

3 回答 3

1

Nope sorry, you can't

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.

于 2012-10-17T22:06:37.277 回答
0

You could add a comment:

a<!--
-->b​​​​​​​​​​​​​​​​​​​​​​​​​
于 2012-10-17T22:05:05.483 回答
0

这与空格折叠无关,因为字符之间只有一个换行符。折叠是将多个连续的空白视为一个空格。

HTML 中没有办法说在忽略换行符的意义上不应用正常的 HTML 空白规则。

在 CSS 中,您可以设置 eg word-spacing: -0.25em,但这0.25em只是空间宽度的粗略近似值。

要使“a”和“b”之间没有空格,请将它们写为“ab”。

于 2012-10-17T22:52:03.697 回答