IE & Doctypes (esp for newbies)

U

UKuser

Hi folks,

I just wanted to share a major discovery (for me) which after about 5
years of web site building I didn't realise.

If you use the HTML doctype for Transitional HTML then the page will
render in Quirks mode (where the box model is broken). However (and
this is the BIG discovery (for me)) - if you use a Strict HTML doctype
then the page actually renders in Standards mode.

I've never really spent long playing with DOCTYPEs to discover this
and maybe just havent read that much about it - still applying hacks
to my CSS to get it working with Transitional.

I've read about triggering Quirks mode - but never realised (that
including IE7) this could be done from the DOCTYPE parameter.

Maybe I'll have to rethink my doctypes!

A
 
R

rf

UKuser said:
Hi folks,

I just wanted to share a major discovery (for me) which after about 5
years of web site building I didn't realise.

Oh my. Where have you been? :)
If you use the HTML doctype for Transitional HTML then the page will
render in Quirks mode (where the box model is broken). However (and
this is the BIG discovery (for me)) - if you use a Strict HTML doctype
then the page actually renders in Standards mode.

Not quite. There is also "almost standards mode" and it does not entirely
depend on transitional/strict, it also depends on the presence of a system
identifier.

You will, however, never get fully standards mode across all browsers, table
cell hight being the problem.

http://en.wikipedia.org/wiki/Quirks_mode
I've never really spent long playing with DOCTYPEs to discover this
and maybe just havent read that much about it - still applying hacks
to my CSS to get it working with Transitional.

Why are you using transitional anyway? Are you transitioning from some
legacy code?
I've read about triggering Quirks mode - but never realised (that
including IE7) this could be done from the DOCTYPE parameter.

The doctype *is* what defines standards/quirks/almost mode.
Maybe I'll have to rethink my doctypes!

Yep :)
 
C

C A Upsdell

UKuser said:
I just wanted to share a major discovery (for me) which after about 5
years of web site building I didn't realise.

If you use the HTML doctype for Transitional HTML then the page will
render in Quirks mode (where the box model is broken). However (and
this is the BIG discovery (for me)) - if you use a Strict HTML doctype
then the page actually renders in Standards mode.

Not exactly true. Transitional with a URL will render in standards
mode, or almost standards mode, depending on the browser. For details
see http://www.upsdell.com/BrowserNews/res_doctype.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top