You need to declare the default DOCTYPE
or Internet Explorer parameter for Quirks mode (IE5 compatible). Go to Internet Explorer, press F12 to open the developer tools, and note that in document mode it shows the "Quirks" mode. Quirks does not support any of the well-known methods of centering divs around, and declaring DOCTYPE is the easiest (and recommended) way to fix it.
To customize the page for XHTML 1.0 Transitional (which is the most common), use
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
To declare a page to be HTML5 compatible, use
<!DOCTYPE html>
The DOCTYPE
line should be the first line in the html file that appears before the opening <html>
.
source share