老师帮忙检查下代码,看看还有没有需要优化的地方。谢谢
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
* {
margin: 0;
padding: 0;
}
.box {
width: 680px;
height: 200px;
}
.one,.two,.three{
float: left;
text-align: center;
margin-right: 20px;
}
.box1 {
width: 200px;
height: 200px;
background-image: -webkit-linear-gradient( top, red,yellow);
}
.box2 {
width: 200px;
height: 200px;
background-image: -webkit-linear-gradient(left, red, yellow);
}
.box3 {
width: 200px;
height: 200px;
background-image: linear-gradient(300deg ,yellow, red);
}
</style>
<body>
<div class="box">
<div class="one">
<h3>上下方向渐变</h3>
<div class="box1"></div>
</div>
<div class="two">
<h3>左右方向渐变</h3>
<div class="box2"></div>
</div>
<div class="three">
<h3>对交方向渐变</h3>
<div class="box3"></div>
</div>
</div>
</body>
</html>19
收起
正在回答 回答被采纳积分+1
1回答








恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星