[thelist] use the xml declaration or not?

Tony Crockford tonyc at boldfish.co.uk
Thu Apr 8 12:14:03 CDT 2004

At 16:14 on Thursday, 08 Apr 2004, Sarah Sweeney wrote:

> What is the difference between using or not using the xml declaration:
> <?xml version="1.0" encoding="UTF-8"?>
> I have a site I'm working on that uses it, but I've been told I  
> shouldn't use it. But if I try removing it, the layout gets slightly  
> messed up in IE. It seems that the widths of some elements are becoming  
> wider. Is there an easy way to fix this, or am I better of just leaving  
> the xml declaration there now?

what's happening is that with the xml prolog in place  (anything, in fact  
before the doctype will do it) IE6 is switching to "quirks mode" - In  
standards mode the width setting in CSS does not incorporate any padding  
and border settings, whereas in quirks mode it does - hence the changes in  
box widths.

There are other issues with quirks mode too.

without the prolog IE renders in standards mode and your page renders as  
it should in standards compliant browsers.
  (have you looked at it in mozilla?)

Heres a more in depth article on doctypes, character encoding etc


(I must read it all through again.... ;o) )



More information about the thelist mailing list