x
1
2
<html>
3
<head>
4
<meta charset="utf-8">
5
<style>
6
#grad1 {
7
height: 100px;
8
background: linear-gradient(0deg, red, blue);
9
/* Safari 5.1 - 6.0 */
10
background: linear-gradient(0deg, red, blue);
11
/* Opera 11.1 - 12.0 */
12
background: linear-gradient(0deg, red, blue);
13
/* Firefox 3.6 - 15 */
14
background: linear-gradient(0deg, red, blue);
15
/* 标准的语法(必须放在最后) */
16
}
17
18
#grad2 {
19
height: 100px;
20
background: linear-gradient(90deg, red, blue);
21
/* Safari 5.1 - 6.0 */
22
background: linear-gradient(90deg, red, blue);
23
/* Opera 11.1 - 12.0 */
24
background: linear-gradient(90deg, red, blue);