Skip to content

Instantly share code, notes, and snippets.

@shuhei
Created November 11, 2014 08:39
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 shuhei/12d75e098811da6eb9b0 to your computer and use it in GitHub Desktop.
Save shuhei/12d75e098811da6eb9b0 to your computer and use it in GitHub Desktop.
画面上下にくっついたヘッダとフッタの間をぴったり埋めるスクロールエリア
<!DOCTYPE html>
<html>
<head>
<style>
div {
position: absolute;
width: 200px;
}
#wrapper {
background-color: #f00;
top: 0;
bottom: 0;
}
#header {
background-color: #f0f;
top: 0;
height: 100px;
}
#content {
background-color: #00f;
top: 100px;
bottom: 150px;
overflow-y: scroll;
}
#something {
background-color: #0ff;
position: static;
height: 2000px;
}
#footer {
background-color: #0f0;
bottom: 0;
height: 150px;
}
</style>
</head>
<body>
<div id="wrapper">
<div id="header"></div>
<div id="content">
<div id="something">
1<br>2<br>3
</div>
</div>
<div id="footer"></div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment