Hello
I am having an issue calculating the viewport height : https://codepen.io/melanie_almeida/pen/gObEEwZ
I will kindly appreciate your help
I also have read the documentation about viewport but still don’t get what is it and how to calculate it.
PS: I have posted my help request in a similar post but got no answer, probably because the latest reply on the thread was old.
snigo
February 9, 2020, 10:02pm
2
Hey @Melanie12 , there is CSS value vh
equal to 1% of viewport height. 100vh
would be height of the viewport.
1 Like
but when I do
#welcome-section {
height:100vh;}
I don’t pass the test
ilenia
February 10, 2020, 11:24am
4
if we take a look at the message just below the failed user story, it says:
The height of #welcome-section is not equal to the height of the viewport : expected 225 to be close to 223 +/- 0
so I used the developer tools to inspect the page, and voilà:
You have a 2px border…
Thank you both for your explanations. It worked
But I could have never found the solution by myself
if you have good ressources about viewport so that I can understand next time what to do, I would be curious to learn!