Page 1 of 1

empty lines at top of source

Posted: Sun 26. Mar 2006, 14:39
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

Posted: Mon 27. Mar 2006, 14:32
by update
Nobody any opinion?
Perhaps it isn't influencing anything at all... But I still have some doubts...

Posted: Mon 27. Mar 2006, 14:45
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

Posted: Tue 28. Mar 2006, 00:02
by pSouper
does anything not work?
why worry?

Posted: Tue 28. Mar 2006, 00:32
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

Posted: Wed 29. Mar 2006, 23:05
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