Hi,

Ok...I asked a question about how to preserve whitespace...I got a variety
of answers (use PRE, use nbsp, use CSS).

I shall clarify the question.

This is *not* a presentation/layout issue.

I have a field that contains leading blanks (space) characters that the user
tells me has semantic meaning that they wish to preserve.


* PRE

If I use PRE, the font will default to some mono fixed-width affair. I could
use CSS styling to change the PRE default I suppose, but the HTML spec
advises against this

I believe we could use CSS to style the PRE text in the required font…but I
have also noted that the HTML spec
http://www.w3.org/TR/html401/struct/text.html#edef-PRE states:


"The DTD fragment above indicates which elements may not appear within
a PRE<http://www.w3.org/TR/html401/struct/text.html#edef-PRE>declaration.
This is the same as in HTML
3.2, and is intended to preserve constant line spacing and column alignment
for text rendered in a fixed pitch font. Authors are discouraged from
altering this behaviour through style sheets."
What is the downside of using styling in PRE?


* CSS

Whilst I am happy to use CSS to style fonts and presentation et cetera...I
don't want to use CSS to preserve the leading spaces because if CSS is
turned off the the leading spaces will be lost...won't they?

Also, if the spaces are preserved using CSS styling will the posted value of
the field contain the leading spaces? (I will test this after I make this
post).


* NBSP

Someone commented that NBSP is "as wide as a piece of string is long". What
are the thoughts on this?


Cheers,

Simon

*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to