View Full Version : Spaces in html, displayed in the browser

Feb 19th, 2003, 09:36 AM
Hi, can anyone help me with this:
In a website, someone enters a lot of tekst, this is displayed in another html-page. Sometimes he wants to separate text with more than one space. The browser removes all the extra spaces, and just displays them as one space. Now i tried to replace them (scriptwise) with a   that part works, but the sentences are no longer wrapped within the display area (duh, it is a nonbreaking space). Is there another sign, like   which is displayed by the browser as a whitespace, but doesn't prevent the browser from wrapping the text?


Feb 19th, 2003, 09:44 AM
If you wan 2 spaces replace with *space*  i.e. mix keyboard spaces and the non-breaking space entity.

Feb 19th, 2003, 04:55 PM
you can use the <pre></pre> to preserve white space.
or a css feature like.

.mypre {

<div class="mypre">
spaces are preserved now!