弘帝企业智能建站系统交流平台

 找回密码
 立即注册
查看: 3495|回复: 2

【CSS3】背景上下线性渐变色脚本

[复制链接]
发表于 2016-3-9 10:00:48 | 显示全部楼层 |阅读模式
background:#c00;
background:-webkit-gradient(linear, left top, left bottom, from(#f00), to(#c00), color-stop(0.5, #e00));
background: linear-gradient(to bottom, #f00 0%,#c00 100%);
1-3行为完整的背景渐变,切勿丢弃任何一行,以免不同的显示器无法显示背景。
第二行支持:chrome,edge
第三行支持:IE
当不支持第一行第二行的CSS语法时,请勿必追加第一行。
示例为:线性渐变,从左上到左下 从红色到深红色,中间色为色EE0000。
回复

使用道具 举报

 楼主| 发表于 2017-2-8 16:36:02 | 显示全部楼层
在线工具:http://www.colorzilla.com/gradient-editor/

各大浏览器解决方案
  1. background: #125792; /* Old browsers */
  2. background: -moz-linear-gradient(top, #125792 1%, #05417f 47%, #04457b 100%); /* FF3.6-15 */
  3. background: -webkit-linear-gradient(top, #125792 1%,#05417f 47%,#04457b 100%); /* Chrome10-25,Safari5.1-6 */
  4. background: linear-gradient(to bottom, #125792 1%,#05417f 47%,#04457b 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
  5. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#125792', endColorstr='#04457b',GradientType=0 ); /* IE6-9 */
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2018-4-20 19:21:38 | 显示全部楼层
渐变效果
background: #125792;
background: -moz-linear-gradient(top, #125792 1%, #05417f 47%, #04457b 100%);
background: -webkit-linear-gradient(top, #125792 1%,#05417f 47%,#04457b 100%);
background: linear-gradient(to bottom, #125792 1%,#05417f 47%,#04457b 100%);
filter: progidXImageTransform.Microsoft.gradient( startColorstr='#125792', endColorstr='#04457b',GradientType=0);
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|弘帝企业智能建站系统 ( 皖ICP备07503252号 )

GMT+8, 2024-4-24 19:00 , Processed in 0.064046 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表