我使用了Colorzilla CSS渐变生成器来创建具有多个颜色中止的背景。它在Firefox和Safari中效果很好,但在Chrome中有一个微妙的条纹/条带化的事情,令人沮丧。这里是我的代码和的jsfiddle链接:Chrome中的渐变条纹
body {
background: rgb(0,0,0); /* Old browsers */
background: -moz-linear-gradient(left, rgba(0,0,0,1) 0%, rgba(85,187,0,1) 15%, rgba(85,187,0,1) 25%, rgba(221,34,85,1) 45%, rgba(221,34,85,1) 55%, rgba(0,136,238,1) 75%, rgba(0,136,238,1) 85%, rgba(0,0,0,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(0,0,0,1)), color-stop(15%,rgba(85,187,0,1)), color-stop(25%,rgba(85,187,0,1)), color-stop(45%,rgba(221,34,85,1)), color-stop(55%,rgba(221,34,85,1)), color-stop(75%,rgba(0,136,238,1)), color-stop(85%,rgba(0,136,238,1)), color-stop(100%,rgba(0,0,0,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, rgba(0,0,0,1) 0%,rgba(85,187,0,1) 15%,rgba(85,187,0,1) 25%,rgba(221,34,85,1) 45%,rgba(221,34,85,1) 55%,rgba(0,136,238,1) 75%,rgba(0,136,238,1) 85%,rgba(0,0,0,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, rgba(0,0,0,1) 0%,rgba(85,187,0,1) 15%,rgba(85,187,0,1) 25%,rgba(221,34,85,1) 45%,rgba(221,34,85,1) 55%,rgba(0,136,238,1) 75%,rgba(0,136,238,1) 85%,rgba(0,0,0,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(left, rgba(0,0,0,1) 0%,rgba(85,187,0,1) 15%,rgba(85,187,0,1) 25%,rgba(221,34,85,1) 45%,rgba(221,34,85,1) 55%,rgba(0,136,238,1) 75%,rgba(0,136,238,1) 85%,rgba(0,0,0,1) 100%); /* IE10+ */
background: linear-gradient(to right, rgba(0,0,0,1) 0%,rgba(85,187,0,1) 15%,rgba(85,187,0,1) 25%,rgba(221,34,85,1) 45%,rgba(221,34,85,1) 55%,rgba(0,136,238,1) 75%,rgba(0,136,238,1) 85%,rgba(0,0,0,1) 100%); /* W3C */
width:100%;
margin-bottom:1em;
}
http://jsfiddle.net/yL82a/ (忽略边距声明)
不知道如何解决这个问题在Chrome仅仅是一个很好的平滑渐变?我已经尝试使用rgba和十六进制值,并得到相同的结果。
我没有看到Firefox和Chrome之间有什么区别,现在我看到,晕倒的不透明条 – 2013-02-14 17:23:17
对我而言,Chrome和Firefox看起来都一样,都有相当明显的乐队。下面是我的最后一张Firefox的截图:http://i.imgur.com/1KwImIF.png – InsomniaBass 2013-02-14 17:25:05
谢谢@moettinger--看起来这就是我的答案。如果你愿意,你可以留下你的回答作为答案,我会将其标记为已接受。 – 2013-02-14 18:55:57