Skip to content

Instantly share code, notes, and snippets.

@fredmontet
Last active August 29, 2015 14:10
Show Gist options
  • Save fredmontet/91d44420ce59aafda1f5 to your computer and use it in GitHub Desktop.
Save fredmontet/91d44420ce59aafda1f5 to your computer and use it in GitHub Desktop.
Media queries
/* Media queries
-------------------------------------------------- */
/* Smartphones (portrait and landscape) ----------- */
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
body{
width:90%;
}
}
/* Smartphones (landscape) ----------- */
@media only screen and (min-width : 321px) {
body{
width:80%;
}
}
/* Smartphones (portrait) ----------- */
@media only screen and (max-width : 320px) {
body{
width:95%;
}
}
/* iPhone 4 ----------- */
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) and (orientation : landscape) and (-webkit-min-device-pixel-ratio : 2) {
body{
width:80%;
}
}
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) and (orientation : portrait) and (-webkit-min-device-pixel-ratio : 2) {
body{
width:95%;
}
}
/* Tablets (portrait and landscape) ----------- */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) {
body{
width:90%;
}
}
/* Tablets (landscape) ----------- */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) {
body{
width:80%;
}
}
/* Tablets (portrait) ----------- */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) {
body{
width:95%;
}
}
/* iPad 3 ----------- */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) and (-webkit-min-device-pixel-ratio : 2) {
body{
width:80%;
}
}
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) and (-webkit-min-device-pixel-ratio : 2) {
body{
width:95%;
}
}
/* Desktops and laptops ----------- */
@media only screen and (min-width : 1224px) {
body{
width:70%;
}
}
/* Large screens ----------- */
@media only screen and (min-width : 1824px) {
body{
width:70%;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment