treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Multiple style sheets in Wordpress

  • I have read about a dozen articles from sources all of the web and can not seem to find the solution I need. I am basically trying to say that if the browser size is above 1200px refer to largestyle.css and below 1200px refers to smallstyle.css. Does anyone have a smart solution or article?
  • <link rel="stylesheet" href="smallstyle.css" media="(max-width: 1200px)">
    <link rel="stylesheet" href="largestyle.css" media="(min-width: 1200px)">
  • Do you replace " /> in the header.php with what you said above?
  • Replace the default style sheet link with the above.
  • <link rel="stylesheet" type="text/css" media="screen" href="<?php bloginfo( 'stylesheet_url' ); ?>" />


    That part?
  • Yes. Just make sure to get the path to the new style sheets correct.

    Also, I have assumed that you are using a HTML5 doctype, and as such, removed the trailing slash, and the type attribute.
  • First you make a folder name css in your theme, then in your main style.css just import css files e-g @import url('css/basic.css'); as it is import other files.
  • @visio your basically using media queries right? My question would be how does the site know which stylesheet to use when the browser is resized if you are just @importing them into the main stylesheet? Would you still not have to do what @joshuanhibbert is saying?