Adam's Awesome Anecdotes

CSS / IE — Quirks Mode Reminder (CSS Centering)

I often forget that IE resorts to “Quirks Mode” if you don’t include the proper DTD line (as the first line in your HTML file), so this is mostly a reminder to myself.  Include the following line and save yourself some debug time!

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd”>

Once you include this, you can resort to the CSS centering technique of fixed-width and ‘auto’ margins:

***** CSS ******
.myDiv
{
  width: 400px;
  margin: auto;
}

I would post the html here, but I can’t figure out how to make Tumblr let me include the necessary html tags in text (without stripping them from the magical post editor)


To Tumblr, Love PixelUnion

We're updating Fluid!

Soon, we'll be updating the look and feel of this theme. Read about the changes here. You can easily turn off this notification in the theme customization panel.

Close