Blog

IE8 max-width, max-height, and inline IE8 css hacks

Posted in How To's on November 12th, 2012 by Maurice Kindermann

Is your max-width or max-height css not working in IE8? Neither was mine. I found plenty of hacks and ways around it, but none of them solved the issue once and for all.

One great little snip-it I found along the way was how to add inline hacks to the CSS file, for example:

width:200px\9; /* ie8 and earlier */
height:200px\9; /* ie8 and earlier */

You can use that, or \8 for IE7 and previous, etc. Great little trick.

BUT, the real culprit? The doctype! Apparently IE8 doesn’t recognise this:

!doctype html

But it DOES recognise this:

!DOCTYPE html

/end.

Leave a Reply

Your email address will not be published.

3,540 Spam Comments Blocked so far by Spam Free Wordpress

HTML tags are not allowed.