html - Apply different CSS stylesheet depending on browser window size - I can't find anything definitive -


help me please if you'd kind...

i having difficulty pinpointing how best go this, google's new algorithm isn't being helpful (spot on) search terms.

my site 100% fluid width , need change stylesheets users @ 1152 / 1024 , below. started off following piece of jscript detect resolution , apply these new stylesheets, doesn't work in ie - great.

i understand stylesheet based on actual browser window best, content has max-width of 1280px, huge resolutions minimised window's won't affected hope, , doubt users bother minimise windows if they're on resolutions on 1024 , below.

here's current code placed in head:

<script type="text/javascript"> var screenwidth = screen.width; if (screen.width < 1280){ document.write('<link rel="stylesheet" href="/assets/templates/common/public/1024res.css" type="text/css" media="screen" />'); } </script> 

so, questions are: 1) why doesn't work in ie? , 2) best route, considering jscript may disabled? know how best achieve this?

any - appreciated!

the non-javascript method:

<link rel="stylesheet" media="screen , (min-device-width: 1152px)" href="800.css" /> 

see: http://css-tricks.com/resolution-specific-stylesheets/


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -