0

How can I create three rows with the following height:

  1. The header should be 70px
  2. Main should be 30% of the screen
  3. Footer should be taking the rest of the space

body {
  width: 100%;
  height: 100%;
  margin: 0px;
  padding: 0px;
}
header {
  background-color: red;
  height: 70px;
  z-index: 10;
  position: relative;
}
main {
  background-color: green;
  height: 30%;
  position: relative;
}
footer {
  background-color: #ddd;
  /* height? */
}
<body>
  <header></header>
  <main></main>
  <footer></footer>
</body>
user3142695
  • 15,844
  • 47
  • 176
  • 332

1 Answers1

1

you can use

width: calc(70% - 70px);

on the footer, see browser support here http://caniuse.com/#feat=calc

Victor Radu
  • 2,262
  • 1
  • 12
  • 18