0

There are two divs. I want second div to occupy the remaining space. Currently it is occupying 100% height but it should take only remaining space.

html, body {
  height: 100%;
  width: 100%;
}

.header {
  background-color: blue;
  color: red;
  font-size: 50px;
}

.content {
  background-color: red;
  height: 100%;
  width: 100%;
}
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
<div class="header">Header</div>
<div class="content">
  </div>
</body>
</html>
Shivaji Mutkule
  • 1,020
  • 1
  • 15
  • 28

1 Answers1

1

it happens because your setting the body to 100%

you can try another approach

  body {
    height: 100%;
    width: 100%;
    display:grid;
    grid-template-columns:1fr;
    grid-template-rows:70px 1fr;
  }

and don't set the height for either of the elements

elad BA
  • 1,760
  • 11
  • 17