Ask coding questions

← Back to all posts
height 100% not working [CSS w HTML]
SilentShadowBla

Why is my height: 100%; not working?
CSS

HTML

but the div is not the full height of the page...

Answered by ash15khng [earned 5 cycles]
View Answer
Voters
SilentShadowBla
Comments
hotnewtop
ash15khng

Can you show us the repl?
I think its not working because the div will take 100% of it's parent element, which is body, which will not take up the whole screen if it doesn't need to. (Your browser's inspect element should be helpful in this case)
You can set body and html to be 100% to fix this:

SilentShadowBla

yes it is working now thanks so much! @ash15khng

ash15khng

@SilentShadowBla No problem!

RixTheTyrunt

Answer: 100vh will do that!