为什么我的background-size和background-position会失效呢?
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>线性渐变</title>
<style type="text/css">
/*此处写代码*/
*{margin:0;padding:0;}
section > div{
width:200px;height:300px;padding-right:90px; float:left;
background-size:200px 200px;
background-position: bottom;
}
div:first-child{
background:linear-gradient(yellow,red) content-box;
}
div:nth-child(2){background: linear-gradient(to right,yellow,red) content-box}
div:last-child{background: linear-gradient(to left top,yellow,red) content-box}
</style>
</head>
<body>
<!--此处写代码-->
<section>
<div>
上下方向渐变
</div>
<div>
左右方向渐变
</div>
<div>
对角方向渐变
</div>
</section>
</html>
0
收起
正在回答 回答被采纳积分+1
1回答
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星