div背景顏色設定成漸變色
小例子:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Document</title>
<style type="text/css">
.linear{
width:50%;
height:30px;
FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=1,startColorStr=#FFFF99,
endColorStr=#6666CC); /*IE*/
background:-moz-linear-gradient(left,#FFFF99,#6666CC);/*火狐*/
background:-webkit-gradient(linear, 0% 0%, 0% 100%,from(#FFFF99), to(#6666CC));/*谷歌*/
}
</style>
</head>
<body>
<div class="linear"></div>
</body>
</html>
注意:
1、IE裡面gradientType(等於“1”表示從左到右漸變,等於“0”表示從上到下漸變);
2、background:-moz-linear-gradient(left,#FFFF99,#6666CC); (等於“left”表示從左到右漸變,等於“top”表示從上到下漸變);