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 小时前
TypeScript 从零基础到精通(五):高级类型与泛型
前端·javascript·typescript
counterxing1 小时前
vibe coding 之后,我更不想打字了
前端·agent·ai编程
copyer_xyf2 小时前
Python 模块与包的导入导出
前端·后端·python
研☆香2 小时前
es6新特性功能介绍(四)
前端·ecmascript·es6
微扬嘴角2 小时前
React篇1--JSX语法规则、组件、组件实例的3大特性
前端·react.js·前端框架
copyer_xyf2 小时前
Python venv 虚拟环境
前端·后端·python
无聊的老谢2 小时前
Vue 3 + TypeScript 构建大型电信运维平台的前端架构设计
前端·vue.js·typescript
xiaofeichaichai3 小时前
Map / Set / WeakMap / WeakSet
前端·javascript
李可以量化3 小时前
成交量的终极量化策略:价量共振指标完整实现(下篇)
前端·数据库·人工智能
copyer_xyf4 小时前
Python 如何同时做很多事:进程、线程、协程
前端·后端·python