1

Gradient of the page is repeating itself. I tried to use background: no repeat but it is not working properly. I also tried to extend the height of the body to 100% but still it is not working. When I tried to use the same code for another page and used linear-gradient(to right, red, green) and linear-gradient(to left, red, green), it worked , but it had the same issue of repeating the gradient when I used linear-gradient(to bottom, red, green). The CSS code is as follows :

body{
    height: 100%;
    background: no-repeat;
    background: linear-gradient(to bottom, red, green);
}

Wanted to know why did this happened ?

Atif Bashir
  • 319
  • 4
  • 13

1 Answers1

0

Add Height on HTML tag 100%

html{height:100%;}
body{
    height: 100%;
    background-repeat: no-repeat;
    background: linear-gradient(to bottom, red, green);

}

https://jsfiddle.net/lalji1051/soujrxyf/3/

Lalji Tadhani
  • 14,041
  • 3
  • 23
  • 40