CSS3兼容各浏览器的线型渐变方法:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<title>线性渐变(linear-gradient)</title>
<style type="text/css">
.gradient{
background: #000000;
background: -moz-linear-gradient(top, #000000 0%, #ffffff 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#000000), color-stop(100%,#ffffff));
background: -webkit-linear-gradient(top, #000000 0%,#ffffff 100%);
background: -o-linear-gradient(top, #000000 0%,#ffffff 100%);
background: -ms-linear-gradient(top, #000000 0%,#ffffff 100%);
background: linear-gradient(to bottom, #000000 0%,#ffffff 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#000000', endColorstr='#ffffff',GradientType=0 );
}
:root .gradient{filter:none;}
</style>
</head>
<body>
<div class="gradient">
垂直渐变
</div> </body>
</html>

如下图所示:

兼容IE哟~~

最新文章

  1. jQuery全选、全不选、反选
  2. 关于C语言的问卷调查
  3. 移植tslib1.4至mini2440
  4. datagridview 定位到最后一行,定位不准的原因
  5. python版本升级及pip部署方法
  6. Hadoop.2.x_WebUV示例
  7. [linux]删除目录下的一类文件
  8. Android-Native-Server 启动和注册详细分析
  9. Python的库和资源(转)
  10. JPA entity versioning (@Version and Optimistic Locking)
  11. Android两种为ViewPager+Fragment添加Tab的方式
  12. a标签的伪元素的应用——link,hover,visited,active
  13. Android开发支付集成——支付宝集成
  14. 继承 &amp; 多态 &amp; 封装
  15. C#中的反射 Reflection
  16. 洛谷水题p1421小玉买文具题解
  17. leetcode:Reverse Integer 及Palindrome Number
  18. Java解析Json字符串--复杂对象
  19. 使用matlibplot.pyplot设置画图的坐标系
  20. 最受欢迎编程语言又是谁?C语言居首,大数据赢了

热门文章

  1. 网页中调用Google地图
  2. js作用域学习
  3. ASP.NET MVC 3 CheckBoxList 的使用
  4. Struts2 配置详解
  5. Web开发的常见面试题HTML和HTML5等
  6. 如何知道btree树的高度
  7. UnicodeDecodeError: &#39;ascii&#39; codec can&#39;t decode byte 0xe5 in position 0: ordinal not in range(128)
  8. html+css复习之第3篇 | jquery | bootstrap
  9. GMF Q&amp;A(1): 如何让palette支持拖拽(DnD)等10则
  10. 监控流量shell脚本