2 回答
TA贡献2051条经验 获得超10个赞
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> div{ /*线性渐变*/ width:300px; height:150px; background:red; /* 一些不支持背景渐变的浏览器 */ background:-moz-linear-gradient(top, red, rgba(0, 0, 255, 0.5)); background:-webkit-gradient(linear, 0 0, 0 bottom, from(#ff0000), to(rgba(0, 0, 255, 0.5))); background:-o-linear-gradient(top, red, rgba(0, 0, 255, 0.5)); } p{ /*径向渐变*/ width:300px; height:150px; background: -webkit-radial-gradient(red, green, blue); /* Safari 5.1 - 6.0 */ background: -o-radial-gradient(red, green, blue); /* Opera 11.6 - 12.0 */ background: -moz-radial-gradient(red, green, blue); /* Firefox 3.6 - 15 */
} </style>
</head> <body> <div>
</div>
<p>
</p> </body> </html> |
TA贡献1818条经验 获得超8个赞
1 2 | // html部分 <div class="box"></div> |
1 2 3 4 5 6 7 8 9 | // css部分 .box{ width: 500px; height: 50px; background: -webkit-linear-gradient(to right,#17c864,#3fccf0); background: -moz-linear-gradient(to right,#17c864,#3fccf0); background: -o-linear-gradient(to right,#17c864,#3fccf0); background: linear-gradient(to right,#17c864,#3fccf0); } |
- 2 回答
- 0 关注
- 1066 浏览
添加回答
举报