Log in

View Full Version : diferrent css for different resolutions



alexdog1805
04-11-2010, 10:30 AM
I want to create a different css for 800*600 resolution and another css for the biggest resolutions.I need to create just 2 css files because the other resolutions look nearly the same size.

djr33
04-11-2010, 07:09 PM
This is not possible in CSS. You can use Javascript to detect the resolution of the window and change based on that, BUT this then requires that Javascript is enabled. Also, many people do not have full-screen windows: they may have two windows on the screen. What would you do in those cases? What about mobile devices? In theory you could try this, but it is almost always a bad idea.
It is much better to just use percentage-based layouts so that it adjusts properly to any size.

If you do want to do this, you can just search "javascript detect resolution" and use that (with if statements) to change the stylesheet.