A
A
Anastasia2020-04-28 15:32:13
JavaScript
Anastasia, 2020-04-28 15:32:13

How to get window size with absolute blocks?

Hello.


I thought this would work:

document.body.style.minHeight = document.body.clientHeight + "px";

but document.body.clientHeightreturns me 83

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2020-04-28
@Seasle

Option 1 .
Option 2 - use flex and center.

S
shsv382, 2020-04-28
@shsv382

And if so?

document.body.style.minHeight = document.documentElement.clientHeight + "px";

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question