gpt4 book ai didi

css - 线性淡出 div、内容和边框(顶部纯色,底部透明)

转载 作者:技术小花猫 更新时间:2023-10-29 10:18:39 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Is it possible to graduate the opacity of an HTML element?

我正在尝试使用 css 使 div(及其边框和内容)淡入透明(即顶部为实心,底部为透明)。

有办法吗?

我可以通过以下方式淡出背景:

.fade-to-nothing
{
background-image: -moz-linear-gradient(top, rgba(255,255,255,1), rgba(255,255,255,0));
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(rgba(255,255,255,1)), to(rgba(255,255,255,0)));
background-image: -webkit-linear-gradient(top, rgba(255,255,255,1), rgba(255,255,255,0));
background-image: -o-linear-gradient(top, rgba(255,255,255,1), rgba(255,255,255,0));
background-image: linear-gradient(to bottom, rgba(255,255,255,1),rgba(255,255,255,0));
background-repeat: repeat-x;
}

但还没有找到对 div 的内容/边框执行此操作的方法。也许有某种嵌套或覆盖?

编辑这是我想做的:

enter image description here

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