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>
相关推荐
胡萝卜术1 小时前
从API调用到手写LRU:力扣146「LRU缓存」的哈希表+双向链表终极进化之路
前端·javascript·面试
科技道人1 小时前
记录 默认置灰/禁用 app ‘Search Engine Selector‘ 的disable按钮
开发语言·前端·javascript
天疆说2 小时前
Zotero Connector 在 Edge 里找不到桌面 Zotero(Linux / Zotero 9.0.6 / Edge 150)
linux·前端·edge
李伟_Li慢慢3 小时前
02-从硬件说起WebGL
前端·three.js
kyriewen4 小时前
看了微软几万人用AI编程的数据——效率涨24%的代价没人提
前端·ai编程·claude
2601_963771374 小时前
How to Scale Your WordPress Store Traffic in 2026
前端·php·plugin
亿元程序员4 小时前
老板说我的3D箭头游戏用来做试玩太普通了,没人想玩,让我变点花样...
前端
李伟_Li慢慢5 小时前
01-threejs架构原理-课程简介
前端·three.js
_瑞6 小时前
深入理解 iOS 渲染原理
前端·ios
IT_陈寒6 小时前
SpringBoot自动配置失灵?你可能忘了这个关键注解
前端·人工智能·后端