请老师检查!(渐变应用)
# 具体遇到的问题
# 报错信息的截图
# 相关课程内容截图
# 尝试过的解决思路和结果
# 粘贴全部相关代码,切记添加代码注释(请勿截图)
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>渐变应用</title>
<style type="text/css">
div{
width: 400px;
height: 400px;
background-color:yellow;
/*补充代码*/
background-size:100px 100px;
background-image:-webkit-linear-gradient(45deg,purple 25%,transparent 25%),
-webkit-linear-gradient(135deg,purple 25%,transparent 25%),
-webkit-linear-gradient(45deg,transparent 75%,purple 75%),
-webkit-linear-gradient(135deg,transparent 75%,purple 75%);
background-image:-moz-linear-gradient(45deg,purple 25%,transparent 25%),
-moz-linear-gradient(-45deg,purple 25%,transparent 25%),
-moz-linear-gradient(45deg,transparent 75%,purple 75%),
-moz-linear-gradient(-45deg,transparent 75%,purple 75%);
background-image:-o-linear-gradient(45deg,transparent 75%,purple 75%),
-o-linear-gradient(-45deg,purple 25%,transparent 25%),
-o-linear-gradient(45deg,transparent 75%,purple 75%),
-o-linear-gradient(-45deg,transparent 75%,purple 75%);
background-image:linear-gradient(45deg,purple 25%,transparent 25%),
linear-gradient(-45deg,purple 25%,transparent 25%),
linear-gradient(45deg,transparent 75%,purple 75%),
linear-gradient(-45deg,transparent 75%,purple 75%);
}
</style>
</head>
<body>
<div></div>
</body>
</html>
正在回答
同学你好,是对着的。因为linear-gradient覆盖了-webkit-linear-gradient,所以-webkit-linear-gradient没有生效。可以注释掉linear-gradient看下:
祝学习愉快~
相似问题
登录后可查看更多问答,登录/注册
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星