gpt4 book ai didi

html - 图片到背景的渐变

转载 作者:行者123 更新时间:2023-11-28 01:06:20 25 4
gpt4 key购买 nike

我想创建一个图片到背景的渐变,有点像这样:

http://jsfiddle.net/yw9v7zm5/

但我希望它不是从下到上淡入淡出,而是从右到左淡入淡出,反之亦然。

即使我尝试过:

background: -moz-linear-gradient(right,  rgba(255,255,255,0) 0%, rgba(255,255,255,1) 80%);

没用!

如有任何帮助,我们将不胜感激!

最佳答案

你必须使用从右到左的线性渐变。看看this fiddle 。

这是更改后的 css 代码。

#container {
position:relative;
padding:50px;
margin:50px;
}
#contents {
background:transparent
}
#gradient {
position: absolute;
z-index: 2;
right: 0;
top: 50px;
left: 50px;
height: 375px;
width: 375px;
background: none;
background: -webkit-linear-gradient(right, rgba(255,255,255,.8) , rgba(226, 226, 226, 0));
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=0 );

}

您可以在此 article 中了解有关 css 渐变的更多信息.

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

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