Making gradient background fill page with css

后端 未结 7 1158
醉酒成梦
醉酒成梦 2020-12-14 01:22

I have this gradient background but I don\'t want it to repeat the way it does to fill the page, I want it to be one large gradient that fills the page.

html:

<
相关标签:
7条回答
  • 2020-12-14 01:52

    I agree with Adrift, adding height: 100% to the html tag will stretch the gradient. You can also remove the background-size: cover. This also works:

    html {
      height: 100%;
    }
    body {
      width: 100%;
      background: linear-gradient(to left top, blue, red);
    }
    

    You should be able to add the rest of the linear gradients for other browsers without any issues. Hope this helps!

    0 讨论(0)
提交回复
热议问题