Reputation: 121
If you write this:
a
b
it will normally render as "a b". I want it to render as "ab". Any thoughts?
Upvotes: 2
Views: 1195
Reputation: 201538
This is not about white space collapsing, since there is just a line break between the characters. Collapsing is about multiple consecutive whitespace being treated as one space.
There is no way in HTML to say that normal HTML whitespace rules be not applied in the sense of ignoring a line break.
In CSS, you could set e.g. word-spacing: -0.25em
, though 0.25em
is just a rough approximation of the width of a space.
To make “a” and “b” rendered without a space between them, write them as “ab”.
Upvotes: 0
Reputation: 1869
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.
Upvotes: 1