as__
as__

Reputation: 77

Set page height to available space on mobiles

I am trying to make my web app take the full height of device.

I am using the 100vh on the body tag to do so, but Safari tab on iOS populates some height by itself so the user is having to scroll down to see the whole page. Is there any workaround?

Thanks.

Upvotes: 0

Views: 44

Answers (1)

Michael Benjamin
Michael Benjamin

Reputation: 372079

Most browsers come with a default margin on the body element. It's usually 8px.

body { margin: 8px; }

This will often launch a vertical scrollbar when the body element is set to 100% height. To remove the overflow, simply override the default with:

body { margin: 0; }

Upvotes: 1

Related Questions