CSS - irregular linear gradient

Why is the background gradient wrong at the end of the page if I resize the window?

http://jsfiddle.net/hca6zz20/2/ - the best example of a gradient from red to blue

http://jsfiddle.net/hca6zz20/

html,
body {
  height: 100%;
}

body {
  background-image: linear-gradient(#363663, #1b1b32);
  margin: 0;
}

Result

+4
source share
2 answers

You need to change:

html,
body {
  height: 100%;
}

To:

html,
body {
  min-height: 100%;
}

Demo

FULLSCREEN DEMO

+2
source

your white div is overflowing, so you need to change the body from 100% to auto.

html,
body {
   height: auto;
}
+2
source

Source: https://habr.com/ru/post/1608173/


All Articles