Skip to content

Instantly share code, notes, and snippets.

@SooJungChae
Created October 16, 2018 06:46
Show Gist options
  • Save SooJungChae/2df71f07a7ad7710fd159e6ea2999bf8 to your computer and use it in GitHub Desktop.
Save SooJungChae/2df71f07a7ad7710fd159e6ea2999bf8 to your computer and use it in GitHub Desktop.
How to import css by screen size

index.html

<link media="(max-width:600px)" href="../../assets/css/style-small.css" rel="stylesheet">
<link media="(min-width:601px)" href="../../assets/css/style-large.css" rel="stylesheet">

style-small.css

@media (max-width:600px) {
    .project-header {
        font-size: 1.2em;
    }
}

style-large.css

@media (min-width: 601px) {
    .project-header {
        font-size: 2em;
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment