类似渐变色弯曲border

类似渐变色弯曲border

因为border-imageborder-radius 不能同时生效。所以使用双层背景实现。注:class属性使用了tailwindcss

  • 实现效果
  • 实现代码
html 复制代码
<div
  class="ml-6 flex h-14 items-center rounded-full border-2 border-transparent px-5"
  style="
    background:
      linear-gradient(#fff, #fff) padding-box,
      linear-gradient(#8362ff, #ff6b6e) border-box;
  "
>
  <span class="bg-gradient-to-r from-[#8362FF] to-[#FF6B6E] bg-clip-text text-lg font-bold whitespace-nowrap text-transparent"> 发起新对话 </span>
</div>
相关推荐
不会敲代码116 小时前
前端组件化样式隔离实战:React CSS Modules、styled-components 与 Vue scoped 对比
css·vue.js·react.js
Sailing20 小时前
🚀 别再乱写 16px 了!CSS 单位体系已经进入“计算时代”,真正的响应式布局
前端·css·面试
球球pick小樱花2 天前
游戏官网前端工具库:海内外案例解析
前端·javascript·css
AAA阿giao3 天前
从零构建一个现代登录页:深入解析 Tailwind CSS + Vite + Lucide React 的完整技术栈
前端·css·react.js
掘金安东尼3 天前
用 CSS 打造完美的饼图
前端·css
掘金安东尼3 天前
纯 CSS 实现弹性文字效果
前端·css
前端Hardy4 天前
HTML&CSS&JS:打造丝滑的3D彩纸飘落特效
前端·javascript·css
前端Hardy4 天前
HTML&CSS&JS:丝滑无卡顿的明暗主题切换
javascript·css·html
parade岁月5 天前
Tailwind CSS v4 — 当框架猜不透你的心思
前端·css
前端Hardy5 天前
HTML&CSS&JS:基于定位的实时天气卡片
javascript·css·html