为什么出不来呢
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>径向渐变</title>
<style type="text/css">
div{
width:200px;height:300px;
float:left;
margin:50px 0 0 50px;
border:1px solid red;
}
/*补充代码,分别写出4个元素的背景渐变效果*/
.div1{
background: -webkit-radial-gradient(60% 40%,closest-side circle, red,yellow,green,blue);
background: -moz-radial-gradient(60% 40%,closest-side circle, red,yellow,green,blue);
background: -o-radial-gradient(60% 40%,closest-side circle, red,yellow,green,blue);
background: radial-gradient(60% 40%,closest-side circle, red,yellow,green,blue);
}
.div2{
background:-webkit-radial-gradient(60% 40%,circle farthest-side, red,yellow,green,blue);
background:-moz-radial-gradient(60% 40%,circle farthest-side, red,yellow,green,blue);
background:-o-radial-gradient(60% 40%,circle farthest-side, red,yellow,green,blue);
background:radial-gradient(60% 40%,circle farthest-side, red,yellow,green,blue);
}
.div3{
background:-webkit-radial-gradient(60% 40%,circle closest-corner, red,yellow,green,blue);
background:-moz-radial-gradient(60% 40%,circle closest-corner, red,yellow,green,blue);
background:-o-radial-gradient(60% 40%,circle closest-corner, red,yellow,green,blue);
background:radial-gradient(60% 40%,circle closest-corner, red,yellow,green,blue);
}
.div4{
background:-webkit-radial-gradient(60% 40%,circle farthest-corner, red,yellow,green,blue);
background:-moz-radial-gradient(60% 40%,circle farthest-corner, red,yellow,green,blue);
background:-o-radial-gradient(60% 40%,circle farthest-corner, red,yellow,green,blue);
background:radial-gradient(60% 40%,circle farthest-corner, red,yellow,green,blue);
}
</style>
</head>
<body>
<div class="div1"></div>
<div class="div1"></div>
<div class="div3"></div>
<div class="div4"></div>
</body>
</html>
正在回答
经测试,效果是可以出来的哦
建议同学详细描述一下是效果运行不出来还是运行出来的效果不正确,以便于大家更加准确地定位你的问题,并帮你解答!
希望可以帮到你~
- 参与学习 1887 人
- 提交作业 4643 份
- 解答问题 5760 个
有HTML和CSS基础,却不知道如何进阶?本路径带你通过系统学习,完成从“会做网页”到“做出好的动态网页”的蜕变,迈出成为前端工程师的第一步。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星