empty lines at top of source

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

empty lines at top of source

Post by update »

Hi,

perhaps a silly question, but anyway:
Why are there empty lines at the very beginning of the source code sometimes like this:

Code: Select all

 


 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
     phpwcms | free open
sometimes even with some blanks heading the <!doctype statement

Code: Select all

 


 
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
     phpwcms | free open
and with other sites not - just like this:

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
     phpwcms | free open
I wonder if this has any influence on how code is interpreted sometimes?
Perhaps somebody has an opinion concerning this.
Looking forward to it

Greetings
claus
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Post by update »

Nobody any opinion?
Perhaps it isn't influencing anything at all... But I still have some doubts...
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Post by update »

found this:
"... Per HTML and XHTML standards, a DOCTYPE (short for “document type declaration”) informs the validator which version of (X)HTML you’re using, and must appear at the very top of every web page. DOCTYPEs are a key component of compliant web pages: your markup and CSS won’t validate without them... "
So how to get rid of these empty lines?

claus
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

does anything not work?
why worry?
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Post by update »

Hi pSouper,
thank for paying some attention :wink:

I have two sites, one set up with phpwcms, the other just "by hand"
Both are relaying on mostly tableless layout. The handmade one has a < li > based navigation and some div containers and the beforementioned DOCTYPE declaration and are displaying almost exactly the same in ff ie ns and opera.
The other one has this DOCTYPE declaration too, but with these empty lines in front of it and is based on phpwcms, rendering very well in ff, but not in ie: besides other mistakes the line spaces between the different < li >s are much wider than in ff.

In the meanwhile I checked the source code again - probably you are right: why worry. It must have something to do with my css, but I'm still irritated because at least the div containers are almost exactly the same but displaying very different :( or I am not able to find the mistake(s)...
:cry:
Example one: * (not ready yet, testpage) displays well (handmade one)
Example two: * (not ready yet too) is rendered quite bad in ie (phpwcms)

Greetings
claus
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Post by update »

I finally got it. It has somefhing to do with that strange box model. Even the uls and lis are interpreted different by different browsers...
Now everything seems to be fine :D
claus
Post Reply