Background Gradient 100% body CSS

I need a body background that used the whole viewport. Time ago I used to see solutions like html{ height: 100%;} or set in the body.

None of these worked for me in my different scenarios when using a background gradient.

Solution: fixed

Adding fixed at the background gradient style fixes everything everywhere. Weather the page is short (smaller than the browser window), long pages, iPad, iPhone...

Here's a background gradient example with the fixed attribute.

View Demo

Leave a Reply

Add <code> Some Code </code> by using this tags.

*
*