Last active
February 17, 2023 17:13
-
-
Save LukeChannings/efdd456bccc3ee1459eacc663e9abc24 to your computer and use it in GitHub Desktop.
Viewport Height Test
This file contains hidden or 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
<meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"> | |
<title>Viewport Height Test</title> | |
<style> | |
body { | |
font-family: -apple-system, 'Helvetica Neue', sans-serif; | |
margin: 0; | |
} | |
main { | |
width: 100vw; | |
height: calc(100vh - env(safe-area-inset-bottom)); | |
display: flex; | |
flex-direction: column; | |
align-items: center; | |
} | |
main > h1 { | |
max-width: 80%; | |
text-align: center; | |
} | |
main > button { | |
margin-top: auto; | |
border-radius: 5px; | |
background-color: hsl(200, 40%, 25%); | |
color: hsl(0, 100%, 100%); | |
padding: 1rem 4rem; | |
font-size: 1rem; | |
margin-bottom: 1rem; | |
} | |
</style> | |
<main> | |
<h1>Does Safari 15 finally fix the viewport height bug?</h1> | |
<button>Yes it does!</button> | |
</main> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment