CSS - 背景渐变和背景图像发送到底部

时间:2014-03-30 04:21:23

标签: html css image background gradient

我正在尝试使用渐变和位于页面底部的图像设置背景。我似乎无法让摊位上班。这是我的代码:

body{
    /* IE10 Consumer Preview */ 
    background-image: -ms-radial-gradient(left top, circle farthest-corner, #FFFFFF 0%, #00A3EF 100%);

    /* Mozilla Firefox */ 
    background-image: -moz-radial-gradient(left top, circle farthest-corner, #FFFFFF 0%, #00A3EF 100%);

    /* Opera */ 
    background-image: -o-radial-gradient(left top, circle farthest-corner, #FFFFFF 0%, #00A3EF 100%);

    /* Webkit (Safari/Chrome 10) */ 
    background-image: -webkit-gradient(radial, left top, 0, left top, 1012, color-stop(0, #FFFFFF), color-stop(1, #00A3EF));

    /* Webkit (Chrome 11+) */ 
    background-image: -webkit-radial-gradient(left top, circle farthest-corner, #FFFFFF 0%, #00A3EF 100%);

    /* W3C Markup, IE10 Release Preview */ 
    background-image: radial-gradient(circle farthest-corner at left top, #FFFFFF 0%, #00A3EF 100%);

    background-image:url("Water.png");
    background-size: 100%;
    background-repeat:no-repeat;
    background-attachment:fixed;
    background-position:bottom; 
}

如何同时获得两者?

此图片:

enter image description here

在这种颜色之上。

enter image description here

1 个答案:

答案 0 :(得分:0)

您需要将网址添加为第一个背景图片选项

background-image:url("water.jpg"), radial-gradient(circle farthest-corner at left top, #FFFFFF 0%, #00A3EF 100%);

这里有一个小提琴.. http://jsfiddle.net/THWLM/

enter image description here