【发布时间】:2021-12-12 15:46:00
【问题描述】:
我正在尝试这样做:
但我找不到如何在 css 或 React 中为卡片制作线性模糊..
【问题讨论】:
-
请提供足够的代码,以便其他人更好地理解或重现问题。
标签: css reactjs react-bootstrap blur
我正在尝试这样做:
但我找不到如何在 css 或 React 中为卡片制作线性模糊..
【问题讨论】:
标签: css reactjs react-bootstrap blur
在你想要的元素上,添加一个叠加层。
.element:after {
content: "";
display: block;
width: 100%;
height: 200px;
position: absolute;
bottom: 0;
pointer-events: none;
background-image: linear-gradient(to bottom, rgba(255,255,255,0) 0%, white 100%);
}
【讨论】:
使用
background-image: linear-gradient(to bottom, rgba(255,255,255,0) 0%, white 100%);
在你想要这个效果的 div 上。
【讨论】: