Skip to content

Instantly share code, notes, and snippets.

@alejandronanez
Last active August 29, 2015 14:02
Show Gist options
  • Save alejandronanez/a0b2863562a00f4fe6fe to your computer and use it in GitHub Desktop.
Save alejandronanez/a0b2863562a00f4fe6fe to your computer and use it in GitHub Desktop.
Media Queries for iPad Portrait / Landscape and Both.
<!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>
#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