There is a fixed height, say 1000. If the screen height becomes less than 1000, then you need to remove 150 pixels from this height from the top and bottom. How can this even be done on pure js?
You can use css media queries for this.
for example lets say your code is
<div class='container'> <p> This is a paragraph </p> </div>
css
.container{
margin-top:150px;
height:1000px
margin-bottom:150px;
}
@media (max-height: 1000px) {
.container{
margin-top:0px;
height:1000px;
margin-bottom:0px;
}
}