第三课--渐变(Gradients)

55 阅读1分钟
a.
线性
background: linear-gradient(to 方向,颜色,颜色);
可以定义一个角度,而不用预定义方向(to bottomto topto rightto leftto bottom right,等等)。

b.
圆性
background: radial-gradient(to 方向,颜色,颜色);
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>渐变(Gradients)</title>
</head>
<style>
    div{
        width: 1504px;
        height: 710px;
        /*background: linear-gradient(to right,red,orange,yellow,green,blue,greenyellow,magenta);!*从左到右*!*/
        /* background: linear-gradient(to bottom right,red,orange,yellow,green,blue,greenyellow,magenta);!*对角*!*/
        background: radial-gradient(red,orange,yellow,green,blue,greenyellow,magenta)
    }
</style>
<body>
<div></div>
</body>
</html>