CSS3之渐变

2020-04-12  本文已影响0人  球丁丁

1.线性渐变(Linear Gradients)- 向下/向上/向左/向右/对角方向

div {
        background-image: linear-gradient(#e66465, #9198e5);
    }
div{
      height: 200px;
      background-image: linear-gradient(to right, red , yellow);
    }
div{
      height: 200px;
      background-image: linear-gradient(to bottom right, red, yellow);
    }
/*从左上角到右下角的线性渐变*/

2.径向渐变(Radial Gradients)- 由它们的中心定义

div{
        background-image: radial-gradient(red, yellow, green);
    }
div{
        background-image: radial-gradient(red 5%, yellow 15%, green 60%);
    }
div{
      background-image: radial-gradient(circle, red, yellow, green);
    }
上一篇 下一篇

猜你喜欢

热点阅读