HTML and Whitespace

Journal started Feb 7, 2002


My biggest pet peeve about HTML: dealing with whitespace. Is it too much trouble to separate carriage return gobbling and space/tab gobbling? Or how about this: even if all whitespace is preserved, how about our browser wraps that 1000 letter long line? Nope. It's either have all whitespace turned into a single space or expecting the creator of the file to insert carriage returns manually into their <pre> output. Heaven forbid you have to read a story in a text file with your web browser!

In Netscape/Mozilla/IE a normal text file with paragraphs delimited with '\n\t' will have each paragraph displayed as one huge long line. That's not an error, or lazy coding; that's the standard.

But you know what? Stylesheets have this nifty thing called a width attribute. A browser supporting style sheets (like Netscape/Mozilla/IE) should be able to do this:

<style> <!-- PRE { width: 100% } --> </style>

And voila, preformatted with word wrapping! It works in Mozilla. ^_^ Still doesn't fix the problem that browsers can't read text files though. -.-


Comment
Index
Previous (It is Okay to "Dump" Radioactive Waste Into Deep Space)
Next (What is the Meaning of Life?)

(cc) some rights reserved