【问题标题】:Multi-stop linear gradient for IE 7-10IE 7-10 的多级线性渐变
【发布时间】:2012-11-17 17:20:54
【问题描述】:

所以我只熟悉使用过滤器和 PIE 的简单渐变,但是我如何使用相同的工具进行多个停止/开始渐变呢?:

background-image: -moz-linear-gradient(center bottom , #0C355C 0%, #082540 50%, #0C355C 51%, #0F4476 100%);
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #0C355C), color-stop(0.5, #082540), color-stop(0.51, #0C355C), color-stop(1, #0F4476));

【问题讨论】:

标签: internet-explorer css linear-gradients


【解决方案1】:

你应该使用这个:

http://www.colorzilla.com/gradient-editor/

示例:

background: #1e5799; /* Old browsers */
background: -moz-linear-gradient(top,  #1e5799 0%, #2989d8 50%, #207cca 51%, #7db9e8 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#1e5799), color-stop(50%,#2989d8), color-stop(51%,#207cca), color-stop(100%,#7db9e8)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top,  #1e5799 0%,#2989d8 50%,#207cca 51%,#7db9e8 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top,  #1e5799 0%,#2989d8 50%,#207cca 51%,#7db9e8 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top,  #1e5799 0%,#2989d8 50%,#207cca 51%,#7db9e8 100%); /* IE10+ */
background: linear-gradient(to bottom,  #1e5799 0%,#2989d8 50%,#207cca 51%,#7db9e8 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e5799', endColorstr='#7db9e8',GradientType=0 ); /* IE6-9 */

【讨论】:

  • IE 渐变滤镜只允许 2 个色标(第一个和最后一个),如果需要 3 个或更多,这对 OP 没有多大帮助。
  • 是的 - 这是唯一的问题。这可以用 Pie 完成吗?还是我有图像的路线..?
  • @user82302124:PIE 在这里帮不上忙,传统图像是最好的选择
  • 这就是我最终要做的——只是一张图片。
  • 多级渐变是 colorzilla 上的一个选项。请检查“ie9 支持”复选框。它为您提供了一个类似于 background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lv...... 的 svg 后备,并且需要一些额外的条件 cmets。
猜你喜欢
  • 2018-06-21
  • 1970-01-01
  • 2019-06-30
  • 1970-01-01
  • 2014-05-11
  • 1970-01-01
  • 2016-08-24
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多