Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CSS Fix for iOS vh-unit Bug
/* fix iOS bug not displaying 100vh correctly */
/* Ipad Pro - Landscape-breakpoint */
@media only screen and (min-device-width : 1024px) and (max-device-width : 1024px) and (min-device-height : 1366px) and (max-device-height : 1366px) and (min-width: 1366px) and (max-width: 1366px) {
.fullheight {
height: 1024px;
}
}
/* Ipad Pro - Portrait-breakpoint */
@media only screen and (min-device-width : 1024px) and (max-device-width : 1024px) and (min-device-height : 1366px) and (max-device-height : 1366px) and (min-width: 1024px) and (max-width: 1024px) {
.fullheight {
height: 1366px;
}
}
/* iPad - Landscape-breakpoint */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) {
.fullheight {
height: 768px;
}
}
/* iPad - Portrait-breakpoint */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) {
.fullheight {
height: 1024px;
}
}
/* iPhone 6/7 plus - Landscape-breakpoint */
@media only screen and (min-device-width: 414px) and (max-device-height: 736px) and (orientation : landscape) and (-webkit-device-pixel-ratio: 2) {
.fullheight {
height: 414px;
}
}
/* iPhone 6/7 plus - Portrait-breakpoint */
@media only screen and (min-device-width: 414px) and (max-device-height: 736px) and (orientation : portrait) and (-webkit-device-pixel-ratio: 2) {
.fullheight {
height: 736px;
}
}
/* iPhone 6/7 - Landscape-breakpoint */
@media only screen and (min-device-width: 375px) and (max-device-height: 667px) and (orientation : landscape) and (-webkit-device-pixel-ratio: 2) {
.fullheight {
height: 375px;
}
}
/* iPhone 6/7 - Portrait-breakpoint */
@media only screen and (min-device-width: 375px) and (max-device-height: 667px) and (orientation : portrait) and (-webkit-device-pixel-ratio: 2) {
.fullheight {
height: 667px;
}
}
/* iPhone5 */
@media only screen and (min-device-width: 320px) and (max-device-height: 568px) and (orientation : landscape) and (-webkit-device-pixel-ratio: 2) {
.fullheight {
height: 320px;
}
}
@media only screen and (min-device-width: 320px) and (max-device-height: 568px) and (orientation : portrait) and (-webkit-device-pixel-ratio: 2) {
.fullheight {
height: 568px;
}
}
/* 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) {
.fullheight {
height: 320px;
}
}
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) and (orientation : portrait) and (-webkit-min-device-pixel-ratio : 2) {
.fullheight {
height: 480px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment