HighDots Forums  

white-space: pre (well supported?)

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss white-space: pre (well supported?) in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jerry Sievers
 
Posts: n/a

Default white-space: pre (well supported?) - 11-05-2003 , 10:00 PM






tried to avoid using PRE in the page markup and instead used DIV
CLASS=foo and assigned the white-space pre property to it.

have some reports already that text is not showing as preformatted.

looks ok with mozilla 1.4 though.

http://www.jerrysievers.com/Projects...&file=Makefile

comments please.

TIA

--
-------------------------------------------------------------------------------
Jerry Sievers 305 854-3001 (home) Unix Administrator/Consultant
305 321-1144 (mobile http://www.JerrySievers.com/

Reply With Quote
  #2  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: white-space: pre (well supported?) - 11-06-2003 , 10:33 AM






Jerry Sievers <jerry (AT) jerrysievers (DOT) com> wrote:

Quote:
tried to avoid using PRE in the page markup and instead used DIV
CLASS=foo and assigned the white-space pre property to it.
Why? If the preformatted form of some text, i.e. the division into lines and
the use of spaces, is essential, why would you rely on CSS instead of
markup? And if it is not, why not let browsers reformat the text as they see
fit? There _are_ in-between cases, but I don't see much point in moving from
PRE to DIV, which _reduces_ the (quasi)semantic information involved.

Quote:
have some reports already that text is not showing as preformatted.
Well, it surely isn't on any browser with CSS support disabled. The document
http://www.blooberry.com/indexdot/cs...whitespace.htm
says that white-space: pre is supported by IE 5.5+ and Netscape 4+ and
Opera 4+, which means rather widespread support - but not universal (I'm
afraid IE 5.0 is still not dead).

Also note: "Conforming user agents may ignore the 'white-space' property in
author and user style sheets but must specify a value for it in the default
style sheet." http://www.w3.org/TR/REC-CSS2/text.h...ef-white-space
(The statement is obscure, and the sample style sheet in CSS2 spec does
_not_ specify a value. The statement has been removed in the CSS 2.1 draft.)

You seem to have some TAB (HT) characters there. Although HTML
specifications defines their meaning in PRE context, they also warn about
inconsistent implementations.

In CSS, the situation is even more obscure. The TAB character is defined as
a whitespace character, but its effect on rendering is not defined. (The
CSS 2.1 draft contains an attempt at a definition, which is basically the
same as in HTML.)

To conclude, I would suggest replacing TABs by spaces and using the PRE
markup, instead of CSS.

--
Yucca, http://www.cs.tut.fi/~jkorpela/


Reply With Quote
  #3  
Old   
Jerry Sievers
 
Posts: n/a

Default Re: white-space: pre (well supported?) - 11-06-2003 , 12:30 PM



i appreciate this info.

"Jukka K. Korpela" <jkorpela (AT) cs (DOT) tut.fi> writes:

Quote:
Jerry Sievers <jerry (AT) jerrysievers (DOT) com> wrote:

tried to avoid using PRE in the page markup and instead used DIV
CLASS=foo and assigned the white-space pre property to it.

Why? If the preformatted form of some text, i.e. the division into lines and
the use of spaces, is essential, why would you rely on CSS instead of
markup? And if it is not, why not let browsers reformat the text as they see
fit? There _are_ in-between cases, but I don't see much point in moving from
i think this is an in between case.

will fix the coding or files as needed to avoid the problem.

this is a basic content mgmt system in the works. the default file
type that is painted into the content part of the page is plain text
(historical reasons only).

seemed prudent to wrap the content window in <div class=pre> and then
jhust read the data in with php.

the minority of files are html with the header part cut away and body
tags replaced with a <div class=html>. was trying to avoid having php
need to determine the file type at run time. also didn't want to have
to edit the plain text files and put <code> or anything else in them.

highly dynamic system with static parts having all common layout
defined in a single set of m4 macro files.

<div class=pre>
php outputs file here...
</div>

so if file happense to have;

<div class=html>
doc body part here...
</div>

this new div just goes back into normal mode. only side effect is a
couple hard line breaks caused by the brief influence of the div with
pre property.

Quote:
PRE to DIV, which _reduces_ the (quasi)semantic information involved.

have some reports already that text is not showing as preformatted.

Well, it surely isn't on any browser with CSS support disabled. The document
yeah! anyway; bottom line is that this approach that i tried isn't
reliable enough for general use (clever though as i might have thought
it was).


thanks for the response.

bye.
--
-------------------------------------------------------------------------------
Jerry Sievers 305 854-3001 (home) Unix Administrator/Consultant
305 321-1144 (mobile http://www.JerrySievers.com/


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.