Last active
August 29, 2015 14:02
-
-
Save alejandronanez/a0b2863562a00f4fe6fe to your computer and use it in GitHub Desktop.
Media Queries for iPad Portrait / Landscape and Both.
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="[add your bin description]" /> | |
<meta charset=utf-8 /> | |
<title>Welcome to JS Bin</title> | |
<meta name="viewport" content="width=device-width"> | |
</head> | |
<body> | |
<p id="ipad-landscape">Only iPad Landscape</p> | |
<p id="ipad-portrait">Only iPad Portrait</p> | |
<p id="ipad-both">Both iPad - Portrait / Landscape</p> | |
</body> | |
</html> |
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
#ipad-landscape { | |
display: none; | |
} | |
#ipad-portrait { | |
display: none; | |
} | |
#ipad-both { | |
display: none; | |
} | |
/* iPads (portrait) ----------- */ | |
@media screen and (min-width : 768px) and (max-width : 1024px) and (orientation : portrait) { | |
#ipad-portrait { | |
display: block; | |
} | |
} | |
/* iPads (landscape) ----------- */ | |
@media screen and (min-width : 768px) and (max-width : 1024px) and (orientation : landscape) { | |
#ipad-landscape { | |
display: block; | |
} | |
} | |
/* iPads (portrait and landscape) ----------- */ | |
@media screen and (min-width : 768px) and (max-width : 1024px) { | |
#ipad-both { | |
display: block; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment