Skip to content

Instantly share code, notes, and snippets.

@ryanve
Created June 26, 2017 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanve/e83ccb0141893b5156cc2395bfadfedd to your computer and use it in GitHub Desktop.
Save ryanve/e83ccb0141893b5156cc2395bfadfedd to your computer and use it in GitHub Desktop.
vmax and vmin fallback technique
@media (orientation: portrait) {
.width-vmax { width: 100vh }
.width-vmin { width: 100vw }
.height-vmax { height: 100vh }
.height-vmin { height: 100vw }
}
@media (orientation: landscape) {
.width-vmax { width: 100vw }
.width-vmin { width: 100vh }
.height-vmax { height: 100vw }
.height-vmin { height: 100vh }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment