Html CSS-当我使用渐变背景时,我发现图像消失了
我知道我很可怜,但我有个问题: 在我的主页中,我使用了一幅图片和一种颜色作为页面的背景。一切正常,但结果…嗯。然后我在互联网上找到了一些代码,可以在背景色上获得一种美妙的渐变色。我认为它会以惊人的方式改进页面 但是 图像消失了。。。如果我把“互联网代码”作为渐变色,图像就会回来。 代码如下:Html CSS-当我使用渐变背景时,我发现图像消失了,html,css,background-image,background-color,Html,Css,Background Image,Background Color,我知道我很可怜,但我有个问题: 在我的主页中,我使用了一幅图片和一种颜色作为页面的背景。一切正常,但结果…嗯。然后我在互联网上找到了一些代码,可以在背景色上获得一种美妙的渐变色。我认为它会以惊人的方式改进页面 但是 图像消失了。。。如果我把“互联网代码”作为渐变色,图像就会回来。 代码如下: #particles-js { width: 100%; /*from here the image*/ background-image: url('../images/Image.png
#particles-js {
width: 100%;
/*from here the image*/
background-image: url('../images/Image.png');
background-repeat: no-repeat;
background-position: center;
background-size: 40% ;
/*from here the code I found on internet*/
background: #e0f3fa;
background: -moz-radial-gradient(center, ellipse cover, #e0f3fa 0%, #d8f0fc 57%, #4dc8f0 100%, #b6dffd 100%);
background: -image-webkit-radial-gradient(center, ellipse cover, #e0f3fa 0%,#d8f0fc 57%,#4dc8f0 100%,#b6dffd 100%);
background: radial-gradient(ellipse at center, #e0f3fa 0%,#d8f0fc 57%,#4dc8f0 100%,#b6dffd 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e0f3fa', endColorstr='#b6dffd',GradientType=1 );
}
多谢各位 请给我们看看你的css,因此,我们可以更好地帮助您。我认为这个答案就是您要寻找的,因为渐变背景不是一种颜色…它被视为背景图像,因此覆盖了您以前的规则。这是因为
background
属性覆盖了先前的background mage
background
是定义一切的快捷方式关于背景。这意味着如果使用background
,也可以定义background图像。请注意,您不能在同一个分区上同时使用线性渐变和背景图像。请向我们展示您的css,因此,我们可以更好地帮助您。我认为这个答案就是您要寻找的,因为渐变背景不是一种颜色…它被视为背景图像,因此覆盖了您以前的规则。这是因为background
属性覆盖了先前的background mage
background
是定义一切的快捷方式关于背景。这意味着如果使用background
,也可以定义background图像。还要注意,不能在同一个div上同时使用线性渐变和背景图像