css 实现四角边框样式

效果如图

此图只实现 左下与右下边角样式

右上与左上同理

复制代码
/*  容器 */
.card-mini {
  position: relative;
}
/*  左下*/
.card-mini::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 20px;
  height: 20px;
  border-bottom: 2px solid #253d64;
  border-left: 2px solid #253d64;
  border-bottom-left-radius: 10px;
}
/*  右下*/
.card-mini::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 20px;
  height: 20px;
  border-bottom: 2px solid #253d64;
  border-right: 2px solid #253d64;
  border-bottom-right-radius: 10px;
}

右上与左上 将上面的bottom改为top

复制代码
.card-mini::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  border-top: 2px solid #253d64;
  border-left: 2px solid #253d64;
  border-top-left-radius: 10px;
}
.card-mini::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 20px;
  height: 20px;
  border-top: 2px solid #253d64;
  border-right: 2px solid #253d64;
  border-top-right-radius: 10px;
}
相关推荐
布列瑟农的星空2 分钟前
大话设计模式——观察者模式和发布/订阅模式的区别
前端·后端·架构
龙在天3 分钟前
Vue3 实现 B站 视差 动画
前端
KenXu5 分钟前
F2C Prompt to Design、AI 驱动的设计革命
前端
小鱼儿亮亮7 分钟前
canvas中画线条,线条效果比预期宽1像素且模糊问题分析及解决方案
前端·react.js
@大迁世界8 分钟前
用 popover=“hint“ 打造友好的 HTML 提示:一招让界面更“懂人”
开发语言·前端·javascript·css·html
伍哥的传说9 分钟前
Tailwind CSS v4 终极指南:体验 Rust 驱动的闪电般性能与现代化 CSS 工作流
前端·css·rust·tailwindcss·tailwind css v4·lightning css·utility-first
小鱼儿亮亮13 分钟前
使用Redux的combineReducers对数据拆分
前端·react.js
定栓19 分钟前
Typescript入门-类型断言讲解
前端·javascript·typescript
码间舞23 分钟前
你不知道的pnpm!如果我的电脑上安装了nvm,切换node版本后,那么pnpm还会共享一个磁盘的npm包吗?
前端·代码规范·前端工程化
用户15129054522026 分钟前
itoa函数
前端