While working on my Angular2 application, I encountered a challenging issue that I can't seem to resolve or find a solution for. Take a look at this image of my page:
https://i.stack.imgur.com/b6KlV.png
Code:
content.component.html
<app-header></app-header>
<div class="content">
</div>
content.component.css
.content{
height: calc(100vh - 60px);
background-color: rgb(167, 167, 167);
}
The header has a fixed height of 60px;
I want to assign a background-color to the content component and I'm in search of a <div>
with specific properties:
- The
<div>
should occupy the entire page without causing unnecessary scrollbars. - This
<div>
should adjust its size when scrollbars appear due to reduced screen width.
I attempted using `height: calc(100vh - headercomponentHeight)` but faced issues when content stacked up and triggered scrollbars, causing the content to overflow from the <div>
.