我正试图在背景图像上叠加CSS渐变。我已经在Firefox中使用它,但在safari和chrome中,我只获取背景图片,没有渐变。带渐变叠加的CSS3背景 - 仅适用于Firefox的渐变
(我生成使用http://www.colorzilla.com/gradient-editor/)在每行的末尾梯度代码,然后简单地添加URL()
更新:看来我的问题可能是WebKit的显示图像背后的梯度,而不是像我需要的顶部,和Firefox。
background: -moz-linear-gradient(top, rgba(0, 0, 0, 0) 0%, rgba(99, 130, 169, 0.7) 100%), url(app/bg.jpg) no-repeat center center fixed; /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0, 0, 0, 0)), color-stop(100%, rgba(99, 130, 169, 0.7))), url(app/bg.jpg) no-repeat center center fixed; /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(0, 0, 0, 0) 0%,rgba(0,0,0,0.16) 100%), url(app/bg.jpg) no-repeat center center fixed; /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(0, 0, 0, 0) 0%,rgba(99, 130, 169, 0.7) 100%), url(app/bg.jpg) no-repeat center center fixed; /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(0, 0, 0, 0) 0%,rgba(99, 130, 169, 0.7) 100%), url(app/bg.jpg) no-repeat center center fixed; /* IE10+ */
background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%,rgba(99, 130, 169, 0.7) 100%), url(app/bg.jpg) no-repeat center center fixed; /* W3C */
你有什么要求阻止你使用图像? – IcedDante
公平的问题,并可能是我最终做的,但我试图只有一个灰度,全屏幕背景图像,然后我可以完全改变使用不同颜色的渐变覆盖的颜色和外观......它是在Firefox中的一个不错的效果... ... – christian