CSS颜色渐变的代码
*{
padding:0px;
margin:0px;
}
#d1
{
width:300px;
height:200px;
border:solid 1px red;
/*颜色渐变 color是表示在0.4百分比的位置加颜色渐变色标,其他的自己读懂它*/
background:-webkit-gradient(linear,left top, left bottom,from(blue),to(red),color-stop(0.4,#fff));
}
#d2
{
width:300px;
height:200px;
border:solid 1px red;
/*颜色渐变 圆的渐变 同样也可以加色标*/
background:-webkit-gradient(radial,center center, 0,center center,200,from(blue),to(red));
}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>练习</title>
<link href ="demo.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div id="d1"></div>
<div id="d2"></div>
</body>
</html>
最后更新于 2022-06-25 12:09:46 并被添加「」标签,已有 1482 位网友阅读过。
本站使用「署名 4.0 国际」创作共享协议,可自由转载、引用,但需署名作者且注明文章出处
此处评论已关闭