WebmasterForums.NET - Webmaster Forums & Directory
 

Go Back   WebmasterForums.NET - Webmaster Forums & Directory > WebmasterForums.NET > Main Webmasters Discussions
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Main Webmasters Discussions This is where we talk about building websites and making money.

Reply
 
Thread Tools Display Modes
Old 07-31-2006, 04:19 PM   #1
Shoshana
Senior Member
 
Shoshana's Avatar
 
Join Date: Jul 2006
Location: NY
Posts: 104
Shoshana is on a distinguished road
Send a message via AIM to Shoshana
Default linebreak ignored inside <pre>

there's a HTML odditity. That is, line break will be ignored inside
<pre> if the adjacent lines are tags.
see the source code and description here:

http://xahlee.org/js/linebreak_after_tag.html

if anyone know the spec for XML case, please let me know. Thanks.
Shoshana is offline   Reply With Quote
Old 07-31-2006, 04:19 PM   #2
Shoshana
Senior Member
 
Shoshana's Avatar
 
Join Date: Jul 2006
Location: NY
Posts: 104
Shoshana is on a distinguished road
Send a message via AIM to Shoshana
Default

The problem is that line breaks are treated in a special way inside a
PRE block. Outside a PRE block line breaks count as normal space
characters and therefore they should be ignored before/after end tags or
start tags because usually one would add line breaks into the source
code just there to make the code more readable. Also any sequence of
space characters, tabs and line breaks (the so called "white spaces")
will be treated as a single space character.
Inside a PRE block, line breaks characters and all other "white space"
characters are treated differently. They do not copllapse into a single
space character, and line breaks must be displayed where they occur and
won't convert into a space character. So I think that Firefox and Safari
don't display your test page correctly.

The problem seems to be the "display:table" for the PRE tag, which
is confusing Firefox and Safari. This is probably a bug in these
browsers.

I assume that you want to use display:table to make the box a small as
needed. Without the modified display property the box would span the
available width completly. You could make the box a float instead and
"clear" it afterwards to get the same effect. And then all browsers
would display it right.
Shoshana is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
Forum Jump


All times are GMT. The time now is 12:02 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
WebmasterForums.NET - Webmaster Forums & Directory