CSS3 gradient background

前端 未结 2 883
栀梦
栀梦 2021-01-04 18:45

Is this right to apply gradient background to the body from a light shade of grey to white from bottom to top?

body {         


        
相关标签:
2条回答
  • 2021-01-04 19:09

    DEMO to support all capable browsers

    body {
      background-color: #ffffff;
      background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#999999));
      background-image: -webkit-linear-gradient(top, #ffffff, #999999);
      background-image:    -moz-linear-gradient(top, #ffffff, #999999);
      background-image:      -o-linear-gradient(top, #ffffff, #999999);
      background-image:         linear-gradient(to bottom, #ffffff, #999999);
    }
    

    CSS3 Please might be useful

    0 讨论(0)
  • 2021-01-04 19:24

    To Zoltan's solution, you could also add:

    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#999999');
    

    to support older IE browsers.

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