Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Static Header and variable body</title>
</head>
<body>
  <header></header>
  <div id="main">
    The main Content
  </div>
</body>
</html>
 
* {
  padding: 0;
  margin: 0;
}
html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}
html,body {
  height:100%;
}
header {
  background: blue;
  height:50px;
  position:relative;
  z-index:1;
}
#main {
  background: red;
  height: 100%;
  position: relative;
  margin-top: -50px;
  padding-top:50px;
}
Output 300px

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers