Forum Moderators: open

Message Too Old, No Replies

Problems adding DOCTYPE

Changes the formatting of floating divs

         

Clanger67

9:40 am on Feb 14, 2006 (gmt 0)



I have developed some web pages and when I went to validate them I realised that I hadn't added the doc type to the page. When I added the doctype it changed the layout.

I now have a horizontal scroll bar as the top div has moved across the page. Below this are 3 other divs. The outer 2 have expanded squeezing the middle one.

Obviously without the doctype my page doesnt validate, but without it my page layout is fine. Any suggestions would be much apprecaited.

David

Robin_reala

11:25 am on Feb 14, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Adding a DOCTYPE pushes IE (and other browsers) into a stricter rendering mode. In IE6 that has the effect of fixing IE5's broken box model. If you're happy with the rendering as you designed it then the quickest fix would be to push IE6 back into quirks mode by putting a comment about the DOCTYPE. N.b., I believe this is fixed in IE7 so you'll have to recode the pages properly at some point.