Make DIV max-height equal to `window height – 100px`

Yes:

#specificElement {
    height: calc(100vh - 100px);
    box-sizing: border-box;
}

This uses the CSS calc() function to subtract 100px from 100vh (1vh being one percent of the view-port’s height) and uses the result as the value of the height property.

The box-sizing forces the browser to include padding, and borders, in the calculated height of the element.

Obviously use a relevant selector for your use-case.

References:

  • calc().
  • CSS lengths.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)