css实现渐变色圆角边框

css实现渐变色圆角边框

渐变色圆角边框(内容区域圆角)

javascript 复制代码
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>渐变色圆角边框(内容区域圆角)</title>
  <style>
      #container {
          width: 800px;
          height: 400px;
          border-radius: 30px;
          background-color: white;
          position: relative;
          padding: 20px;
          margin: 50px;
      }

      #container::before {
          content: '';
          position: absolute;
          top: -30px;
          right: -30px;
          bottom: -30px;
          left: -30px;
          border-radius: inherit;
          background: linear-gradient(96deg, #26d2e0 0%, #437bb3 97%);
          z-index: -1;
      }
  </style>
</head>
<body>
<div id="container">内容</div>
</body>
</html>

渐变色圆角边框(内容区域直角)

javascript 复制代码
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>渐变色圆角边框(内容区域直角)</title>
  <style>
      #container {
          position: relative;
          width: 800px;
          height: 400px;
          border: 30px solid;
          border-image: linear-gradient(45deg, #26d2e0, #437bb3) 1;
          clip-path: inset(0 round 30px);
          margin: 50px;
      }
  </style>
</head>
<body>
<div id="container">内容</div>
</body>
</html>
相关推荐
人生鹿呀27 分钟前
AI 情绪陪伴助手:从 0 到 1 的 PWA + 跨端应用实战
前端
人生鹿呀32 分钟前
从零打造滑板文化社区平台:React 19 + Node.js + AI 微服务全栈实战
前端
网络工程小王1 小时前
【LCEL 链式调用详解】调用篇-2
java·服务器·前端·数据库·人工智能
swipe1 小时前
别把语音 Agent 当成“接两个 API”——用 NestJS 搭一套 ASR + LLM + 流式 TTS 的实时语音助手
前端·后端·llm
GISer_Jing1 小时前
AI Agent中游产业链全景拆解:智能体开发的核心生态与技术版图
前端·人工智能·后端
前端之虎陈随易2 小时前
2年没用Nodejs了,Bun很香
linux·前端·javascript·vue.js·typescript
Hooray2 小时前
用时7天,花费30元,我vibe coding这个网站
前端·agent·ai编程
小小高不懂写代码2 小时前
RAG--检索增强生成--原理及实战
前端·人工智能
空中海2 小时前
04 工程化、质量体系与 React 生态
前端·ubuntu·react.js
好运的阿财3 小时前
OpenClaw工具拆解之host_workspace_write+host_workspace_edit
前端·javascript·人工智能·机器学习·ai编程·openclaw·openclaw工具