niorad.com/blog

Setting minimum width only for non-media-query browsers

October 18, 2012

If you want to set a minumum width for browsers that don’t support media queries, like IE8, you just have to set a minimum width to the body, and remove that in a media query, like this:

body {
min-width:700px;
}

@media screen and (min-width: 1px) {
body {
min-width:0;
}
}


The min-width will get removed only for modern browsers.

(EDIT: Of course you can use Modernizr if you have more than one or two things to adjust. For this certain project I only needed a fixed width)