By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,564 Members | 810 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,564 IT Pros & Developers. It's quick & easy.

Is it possible to "just make spaces visible"?

P: n/a
Hello,

my problem is that spaces are always reduced to the size of one in html.
I need some trick to make all spaces in a line visible.

Something like this is possible with "<pre>" in HTML, but with this I
get my newlines twice as "<pre>" interprets newlines *and* "<br>" (and
no, in my case it's not easy to get rid of the "<br>").

Is something like this possible?

Thank you very much in advance

CU

Manuel
Mar 14 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Manuel Reimer wrote:
Hello,

my problem is that spaces are always reduced to the size of one in html.
I need some trick to make all spaces in a line visible.

Something like this is possible with "<pre>" in HTML, but with this I
get my newlines twice as "<pre>" interprets newlines *and* "<br>" (and
no, in my case it's not easy to get rid of the "<br>").

Is something like this possible?

Thank you very much in advance

CU

Manuel


Manuel,

In HTML, multiple consecutive spaces are compressed into one by default.
There are two ways to avoid this:
- Avoid multiple consecutive spaces by using the &nbsp; character
entity reference, e.g. I want to leave lots &nbsp; &nbsp; &nbsp; of
space in here.
- Alter the default behavior with CSS, by specifying white-space. See
http://www.w3.org/TR/CSS21/text.html...ef-white-space. Some options
may not work on all browsers; you'll have to do some testing.

Chris Beall

Mar 14 '06 #2

P: n/a
Manuel Reimer wrote:
my problem is that spaces are always reduced to the size of one in html.
I need some trick to make all spaces in a line visible.


Why? Are you trying to line up columns of data? That is the job of a table.
Do you want to indent text? That is the job of text-indent, margin and
padding.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Mar 14 '06 #3

P: n/a
Manuel Reimer wrote:
Hello,

my problem is that spaces are always reduced to the size of one in html.
I need some trick to make all spaces in a line visible.

Something like this is possible with "<pre>" in HTML, but with this I
get my newlines twice as "<pre>" interprets newlines *and* "<br>" (and
no, in my case it's not easy to get rid of the "<br>").


Then get rid of the newlines. Or change the spaces to non-breaking spaces.
Mar 15 '06 #4

P: n/a
Tue, 14 Mar 2006 23:45:03 +0100 from Manuel Reimer
<Ma***************@nurfuerspam.de>:
Hello,

my problem is that spaces are always reduced to the size of one in html.
I need some trick to make all spaces in a line visible.

Something like this is possible with "<pre>" in HTML, but with this I
get my newlines twice as "<pre>" interprets newlines *and* "<br>" (and
no, in my case it's not easy to get rid of the "<br>").


<pre>
Line 1
Line 2
Line 3</pre>

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won't Help You:
http://diveintomark.org/archives/200..._wont_help_you
Mar 15 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.