Created
August 17, 2016 00:52
-
-
Save spac3unit/239667af2889af46fec7ce85a901344c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Desktop First */ | |
/* Large screens ----------- */ | |
/*some CSS*/ | |
/* Desktops and laptops ----------- */ | |
@media only screen and (max-width : 1824px) {...} | |
/* iPads (landscape) ----------- */ | |
@media only screen and (max-width : 1224px) {...} | |
/* iPads (portrait) ----------- */ | |
@media only screen and (max-width : 1024px) {...} | |
/* Smartphones (landscape) ----------- */ | |
@media only screen and (max-width : 768px) {...} | |
/* Big smartphones (portrait) (ie: Galaxy 3 has 360)*/ | |
@media only screen and (max-width : 640px) {...} | |
/* Smartphones (portrait) (ie: Galaxy 1) */ | |
@media only screen and (max-width : 321px) {...} | |
The second approach is to go 'Mobile First'. That mean that your base CSS will aim at small screens like the IPhone 4. Then your media query will overwrite your classes to adapt to bigger screens. Here's and example : | |
/* Mobile First */ | |
/* Smartphones (portrait) ----------- */ | |
/* Ipad2 (portrait) ----------- */ | |
@media only screen and (min-width : 768px){...} | |
/* Ipad2 (paysage) ----------- */ | |
@media only screen and (min-width : 1024px){...} | |
/* Ordi (Petit) ----------- */ | |
@media only screen and (min-width : 1224px){...} | |
/* Desktops and laptops ----------- */ | |
@media only screen and (min-width : 1824px){...} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment