可以这样写吗
来源:3-2 编程练习
杨子123
2020-07-28 15:26:19
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>线性渐变</title>
<style type="text/css">
/*此处写代码*/
body{width:550px;}
div
{width:150px;
height:150px;
display:inline-block;
margin-right:20px;
}
body>div:nth-of-type(1){background:linear-gradient(yellow,red);}
body>div:nth-of-type(2){background:linear-gradient(to right,yellow,red)}
body>div:nth-of-type(3){background:linear-gradient(to right bottom,red,yellow);}
p{margin-top:10px;}
</style>
</head>
<body>
<!--此处写代码-->
<div></div>
<div></div>
<div></div>
</html>
1回答
好帮手慕星星
2020-07-28
同学你好,渐变效果实现很棒!
优化:建议将效果上的文字添加上
祝学习愉快!
相似问题