【发布时间】:2016-09-07 05:53:54
【问题描述】:
我现在正在建立一个网站并尝试设置一个带有背景图像的部分以覆盖所有生成的部分和渐变背景。 我尝试将它们放在一起,但它并没有真正起作用,这就是我尝试过的: https://jsfiddle.net/gmtujnmh/
#fullcover {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-size: cover;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-position: center;
max-height: 60%;
display: inline;
background-image: url(http://www.materials-world.com/bricks/belden/whites/images/AlaskaWhiteVelourWT.jpg);
/* fallback */
background: rgba(62, 21, 49, 1);
background: -moz-linear-gradient(-45deg, rgba(62, 21, 49, 1) 0%, rgba(162, 23, 128, 1) 100%);
background: -webkit-gradient(left top, right bottom, color-stop(0%, rgba(62, 21, 49, 1)), color-stop(100%, rgba(162, 23, 128, 1)));
background: -webkit-linear-gradient(-45deg, rgba(62, 21, 49, 1) 0%, rgba(162, 23, 128, 1) 100%);
background: -o-linear-gradient(-45deg, rgba(62, 21, 49, 1) 0%, rgba(162, 23, 128, 1) 100%);
background: -ms-linear-gradient(-45deg, rgba(62, 21, 49, 1) 0%, rgba(162, 23, 128, 1) 100%);
background: linear-gradient(135deg, rgba(62, 21, 49, 1) 0%, rgba(162, 23, 128, 1) 100%);
filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#3e1531', endColorstr='#a21780', GradientType=1);
}
<div id="fullcover"></div>
它取自 cssmatic 的渐变代码,有人可以帮帮我吗?
【问题讨论】:
-
this 你想做什么?
-
是,但渐变不起作用
-
嗯,为什么是渐变和全图?你想玩 oppacity 吗?
-
如果你想覆盖整个屏幕只需删除 max-height
-
exaclty,问题出在 wordpress 网站上,我无法制作另一个部分或 div
标签: css background-image gradient