-2

I am css begginer and i have a problem with div arrengment.

I want to place a div in the top part of the screen, 150px 100% width. and another div right below which will take the reminder part of the screen.

If I add the second div "height: 100%" it surpass the screen size and makes me scroll and i dont want that. just that it will take the free screen area, and adjust to window size.

thank you!!

amit9676
  • 1
  • 1

1 Answers1

0

#top{
background-color:blue;
height:150px;

}
#bottom{
background-color:green;
height:calc(100vh - 150px - 16px) ;
}
<div id='top'></div>
<div id='bottom'></div>
DCR
  • 14,737
  • 12
  • 52
  • 115