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>
相关推荐
鹏北海2 小时前
JSBridge 原理详解
前端
孟健2 小时前
我的网站被黑了:一天灌入 227 万条垃圾数据,AI 写的代码差点让我社死
前端
anOnion2 小时前
构建无障碍组件之Checkbox pattern
前端·html·交互设计
IT枫斗者4 小时前
IntelliJ IDEA 2025.3史诗级更新:统一发行版+Spring Boot 4支持,这更新太香了!
java·开发语言·前端·javascript·spring boot·后端·intellij-idea
N***p3654 小时前
Spring Boot项目接收前端参数的11种方式
前端·spring boot·后端
享誉霸王5 小时前
15、告别混乱!Vue3复杂项目的规范搭建与基础库封装实战
前端·javascript·vue.js·前端框架·json·firefox·html5
a1117766 小时前
飞机躲避炸弹 网页游戏
前端·开源·html·threejs
夏乌_Wx6 小时前
mybash:简易 Shell 实现的设计思路与核心模块解析
linux·服务器·前端
滕青山6 小时前
URL编码/解码 核心JS实现
前端·javascript·vue.js
菜鸟小芯7 小时前
【GLM-5 陪练式前端新手入门】第五篇:响应式适配 —— 让个人主页 “见机行事”
前端·人工智能