<!DOCTYPE html>
<
html
>
<
head
>
<
meta
charset
=
"UTF-8"
>
<
title
>线性渐变</
title
>
<
style
type
=
"text/css"
>
/*此处写代码*/
div {
width:100px;
height:100px;
float:left;
margin-right:10px;
}
.box1 {
background-image:linear-gradient(to bottom,yellow,red);
}
.box2 {
background-image:linear-gradient(to right,yellow,red);
}
.box3 {
background-image:linear-gradient(145deg,red,yellow);
}
</
style
>
</
head
>
<
body
>
<
div
class
=
"box1"
></
div
>
<
div
class
=
"box2"
></
div
>
<
div
class
=
"box3"
></
div
>
</
html
>
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧