很难让我的背景图像放在我的CSS渐变之上。这就是我所拥有的,但是当我在手机上打开它时,图像就在渐变背景之后。它正用于移动设备,最新版本的IOS和Android。
body {
background-size:cover;
background-image: linear-gradient(bottom, rgb(20,36,130) 44%, rgb(255,255,255) 67%, rgb(7,22,137) 26%), url(main_BG.png);
background-image: -o-linear-gradient(bottom, rgb(20,36,130) 44%, rgb(255,255,255) 67%, rgb(7,22,137) 26%), url(main_BG.png);
background-image: -moz-linear-gradient(bottom, rgb(20,36,130) 44%, rgb(255,255,255) 67%, rgb(7,22,137) 26%), url(main_BG.png);
background-image: -webkit-linear-gradient(bottom, rgb(20,36,130) 44%, rgb(255,255,255) 67%, rgb(7,22,137) 26%),url(main_BG.png);
background-image: -ms-linear-gradient(bottom, rgb(20,36,130) 44%, rgb(255,255,255) 67%, rgb(7,22,137) 26%),url(main_BG.png);
background-repeat:no-repeat, no-repeat;
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.44, rgb(20,36,130)),
color-stop(0.67, rgb(255,255,255)),
color-stop(0.26, rgb(7,22,137)),url(main_BG.png);
);
}
答案 0 :(得分:0)
只需将图片网址放在第一位即可。
background-image:url(main_BG.png), linear-gradient(bottom, rgb(20,36,130) 44%,
rgb(255,255,255) 67%, rgb(7,22,137) 26%);