<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
.border-linear-radius {
--border-radius: 5px;
--border-width: 1px;
--border-color: linear-gradient(180deg,
rgba(44, 135, 124, 1),
rgba(95, 250, 255, 1),
rgba(63, 166, 156, 1));
width: 200px;
height: 80px;
position: relative;
color: #fff;
border-radius: var(--border-radius);
background: rgba(125, 70, 93, 0.2);
backdrop-filter: blur(10px);
}
.border-linear-radius::after {
content: "";
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
padding: var(--border-width);
border-radius: var(--border-radius);
background: var(--border-color);
--mask-bg: linear-gradient(red, red);
--mask-clip: content-box, padding-box;
-webkit-mask-image: var(--mask-bg), var(--mask-bg);
-webkit-mask-clip: var(--mask-clip);
mask-composite: exclude;
-webkit-mask-composite: destination-out;
}
body {
font-size: 16px;
display: flex;
align-items: center;
justify-content: center;
background: blue;
color: #fff;
overflow: hidden;
height: 100vh;
}
</style>
<title>渐变边框+圆角透明背景效果</title>
</head>
<body>
<div class="linear-border-radius">背景透明</div>
</body>
</html>
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix