<style type="text/css">
.test1{ width: 80%; min-height: 80px; text-align: center; line-height: 80px; color: White; font-size: 20px;
filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr='#00BFFF',endColorStr='#0000CD',gradientType='0');
background: -moz-linear-gradient(top, #00BFFF, #0000CD);
background: -o-linear-gradient(top,#00BFFF, #0000CD);
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#00BFFF), to(#0000CD));
}
.test2{ width: 80%; min-height: 80px; text-align: center; line-height: 80px; margin-bottom: 10px; color: White; font-size: 20px;
filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr='#00BFFF',endColorStr='#0000CD',gradientType='0');
background: -moz-linear-gradient(bottom, #00BFFF, #0000CD);
background: -o-linear-gradient(bottom,#00BFFF, #0000CD); background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#00BFFF), to(#0000CD));
}
.test3 { width: 45%; min-height: 80px; text-align: center; line-height: 80px; margin-bottom: 10px; color: White; font-size: 20px;
filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr='#00BFFF',endColorStr='#0000CD',gradientType='1');
background: -moz-linear-gradient(left, #00BFFF, #0000CD);
background: -o-linear-gradient(left,#00BFFF, #0000CD);
background: -webkit-gradient(linear, 0% 0%, 100% 0%, from(#00BFFF), to(#0000CD));
}
.test4 { width: 45%; min-height: 80px; text-align: center; line-height: 80px; margin-bottom: 10px; color: White; font-size: 20px;
filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr='#00BFFF',endColorStr='#0000CD',gradientType='1');
background: -moz-linear-gradient(right, #00BFFF, #0000CD);
background: -o-linear-gradient(right,#00BFFF, #0000CD);
background: -webkit-gradient(linear, 0% 0%, 100% 0%, from(#00BFFF), to(#0000CD));
}
</style>
<div>
<div class="test1">垂直渐变:上->下</div>
<div class="test2">垂直渐变:下->上</div>
</div>
<div>
<div class="test3" style="display: inline-block;">水平渐变:左->右</div>
<div class="test4" style="display: inline-block;">水平渐变:右->左</div>
</div>