Skip to content

Instantly share code, notes, and snippets.

@idevwise
Last active September 10, 2017 17:10
Show Gist options
  • Save idevwise/f39b5dcb8edb6a3b454b7d6c37848350 to your computer and use it in GitHub Desktop.
Save idevwise/f39b5dcb8edb6a3b454b7d6c37848350 to your computer and use it in GitHub Desktop.
Absolutely positioned layout
.app-container {
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
}
header, footer, main {
position: absolute;
left: 0;
width: 100%;
}
header {
top: 0;
}
footer {
bottom: 0;
}
header, footer {
text-align: center;
background-color: blue;
color: white;
height: 48px;
line-height: 48px;
}
footer input {
width: 50%;
}
main {
top: 48px;
bottom: 48px;
background-color: yellow;
color: red;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
.safari.keyboard .app-container {
bottom: 270px;
}
/*To prevent auto-zoom in Safari*/
.safari input[type='text'] {
font-size: 16px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment