Reputation: 113
I always get height: 0 on the body, Why this happens?
Either I use height, min-height, etc.
Upvotes: 8
Views: 11602
Reputation: 1
This is caused because of parent height is 0. Follow these styles up!
html{
height: -webkit-fill-available;
}
body{
height: 100%;
}
Upvotes: 0
Reputation: 11
Height = 0 because the parent of the elements have 0 height, so make sure your parent, which is body here have 100% height or else.
body {
height: 100%
}
Upvotes: 0
Reputation: 3478
Just use:
body{
height:100vh;
}
This will force the body to 100% viewport height regardless of the page contents.
Upvotes: 14