gpt4 book ai didi

html - css背景图片透明

转载 作者:行者123 更新时间:2023-11-28 05:00:02 24 4
gpt4 key购买 nike

原来我的 CSS 是,

  .featured .content-wrapper
{
background-color: #7ac0da;
background-image: -ms-linear-gradient(left, #7ac0da 0%, #a4d4e6 100%);
background-image: -o-linear-gradient(left, #7ac0da 0%, #a4d4e6 100%);
background-image: -webkit-gradient(linear, left top, right top, color-stop(0, #7ac0da), color-stop(1, #a4d4e6));
background-image: -webkit-linear-gradient(left, #7ac0da 0%, #a4d4e6 100%);

color: #3e5667;
padding: 20px 40px 30px 40px;
}

显示喜欢: old-image

然后我想加一张图片,CSS变成了:

   .featured .content-wrapper
{
background-color: #7ac0da;
background-image: -ms-linear-gradient(left, #7ac0da 0%, #a4d4e6 100%);
background-image: -o-linear-gradient(left, #7ac0da 0%, #a4d4e6 100%);
background-image: -webkit-gradient(linear, left top, right top, color-stop(0, #7ac0da), color-stop(1, #a4d4e6));
background-image: -webkit-linear-gradient(left, #7ac0da 0%, #a4d4e6 100%);
background-image: url('../Images/love.png');
color: #3e5667;
padding: 20px 40px 30px 40px;
}

我只添加了一张图片

background-image: url('../Images/love.png');

现在它显示: new-image

我想要的是让背景颜色 #3e5667 仍然可见。

如何修改CSS?

最佳答案

您可以像这样在 CSS3 中同时定义背景图像和渐变:

background: #7ac0da;
background-image: url('../Images/love.png'); /* fallback */
background-image: url('../Images/love.png'), -webkit-gradient(linear, left top, left bottom, from(#7ac0da), to(#999999)); /* Saf4+, Chrome */
background-image: url('../Images/love.png'), -webkit-linear-gradient(top, #7ac0da , #a4d4e6 ); /* Chrome 10+, Saf5.1+ */
background-image: url('../Images/love.png'), -moz-linear-gradient(top, #7ac0da , #a4d4e6 ); /* FF3.6+ */
background-image: url('../Images/love.png'), -ms-linear-gradient(top, #7ac0da , #a4d4e6 ); /* IE10 */
background-image: url('../Images/love.png'), -o-linear-gradient(top, #7ac0da , #a4d4e6 ); /* Opera 11.10+ */
background-image: url('../Images/love.png'), linear-gradient(top, #7ac0da , #a4d4e6 ); /* W3C */

关于html - css背景图片透明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16986490/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com