Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programme scripted pages and CSS 2

Status
Not open for further replies.

DaRNCaT

Technical User
Joined
Dec 18, 2002
Messages
566
Location
NZ
I found this on
while looking for tips on getting my CSS right.

IE5, IE5.5 and IE6 in quirks mode use what is commonly known as the broken box model. All other modern browsers use the correct box model. The box model is how an elements dimensions are defined. (Note quirks mode in IE is triggered by not having a doctype or using a partial html doctype without uri. It is also triggered accidentally in xhtml by using the xml prologue or in fact [red]by having any content above the doctype.)[/red]

can anyone tell me how dynamically generated pages are affected by this, i.e., if I am using PHP and I put a big block of PHP code above the <html> tag, will this cause IE to revert to quirks mode?
And what about Includes, will they also affect it?
Thanks


----------------------------------------
Sometimes, when my code just won't behave, I take it outside and make it listen to britney spears music, and when it comes back it's really well behaved. I wonder if it's suffering from post tramatic stress syndrome now..
 
I believe that IE reads only what your page outputs, so as long as you don't echo anything before the doctype, you should be fine. Same for includes.

--Chessbot

"See the TURTLE of enormous girth!"
-- Stephen King, The Dark Tower series
 
it's having this
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
before the doctype that throws IE back into quirks mode but PHP falls over on it first unless it's echo'ed in as a string.
Having PHP code above the doctype makes no difference unless it sends browser output (not headers or sessions). Which of course should never happen unless you are debugging functions etc and sending screen output.

Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Thanks!
That makes life alot easier, I was imagining all sorts of problems with pages if you had to allow for code inserts above the html tags.

----------------------------------------
Sometimes, when my code just won't behave, I take it outside and make it listen to britney spears music, and when it comes back it's really well behaved. I wonder if it's suffering from post tramatic stress syndrome now..
 
The thing to bear in mind about PHP (and other server-side technologies) is that they do their job on the server. By the time the page reaches the browser the PHP code has run, done it's job and effectively disappeared.

What the browser sees is what you see if you do a "View Source" - an ordinary (X)HTML document without any PHP code in it. It's totally different to Javascript, where you send out some source code for the browser to execute.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top