html - Apply styles based upon javascript condition -


i have 2 separate <style> tags both contain large number of styles , media queries. first set of styles applied desktop viewers, other set applied mobile viewers. when both sets of media queries run, messes display because different components visible @ different sizes. had been dynamically linking style sheets based upon user display, have been asked on 1 page no additional file loading. there way can apply 1 set of styles or other exclusively via javascript?

you can mobile detection in javascript add class depending on styles want. ie.

<body>   <div class="mobile">     .. page ..   </div> </body> 

or

<body>   <div class="desktop">     .. page ..   </div> </body> 

Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -