0
点赞
收藏
分享

微信扫一扫

径向渐变(放射性)

Gascognya 2022-06-16 阅读 70
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<style>
#div1 {
width: 500px;
height: 500px;
background-image: radial-gradient(red, pink);
/*
默认情况下径向渐变的形状来计算的
正方形 --> 圆形
长方形 --> 椭圆形
我们也可以手动指定径向渐变的大小
circle
ellipse

也可以指定渐变的位置
语法:
radial-gradient(大小 at 位置 ,颜色 位置,颜色 位置)
大小:
circle 圆形
ellipse椭圆
closest-side 近边
closest-corner 近角
farthest-side 远边
farthest-corner 远角
*/
}
</style>
<body>
<div id="div1"></div>
</body>
</html>

 


举报

相关推荐

0 条评论