Skip to content

Instantly share code, notes, and snippets.

@adityab
Created February 5, 2014 14:35
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 adityab/8824899 to your computer and use it in GitHub Desktop.
Save adityab/8824899 to your computer and use it in GitHub Desktop.
<html>
<head>
<meta name="viewport" content="width=device-width, target-densityDpi=device-dpi, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<script>
</script>
<style>
#toolbar {
text-align: center;
overflow: hidden;
top: 0;
left: 0;
right: 0;
position: fixed;
z-index: 5;
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
height: 100px;
background: green;
}
#inputs {
text-align: center;
background-color: #ddd;
overflow: auto;
-webkit-overflow-scrolling: touch;
position: absolute;
top: 100px;
bottom: 0;
left: 0;
right: 0;
}
input {
display: block;
margin: 50px;
margin-left: auto;
margin-right: auto;
}
h1 {
font-size: 50px;
margin: 0;
}
</style>
</head>
<body>
<div id="mainContainer">
<div id="toolbar">
<h1>Toolbar</h1>
<p>This toolbar should not move when an input below gets focus.</p>
</div>
<div id="inputs">
<p> Inputs: </p>
<input type="text"/>
<input type="text"/>
<input type="text"/>
<input type="text"/>
<input type="text"/>
<input type="text"/>
<input type="text"/>
<input type="text"/>
<input type="text"/>
<input type="text"/>
<input type="text"/>
<input type="text"/>
<input type="text"/>
<input type="text"/>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment