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 小时前
实现在 UnoCSS 中使用任意深度颜色的预设
前端·css
charlie1145141912 小时前
CSS学习笔记3:颜色、字体与文本属性基础
css·笔记·学习·教程·基础
一 乐2 小时前
二手车销售|汽车销售|基于SprinBoot+vue的二手车交易系统(源码+数据库+文档)
java·前端·数据库·vue.js·后端·汽车
Giant1003 小时前
如果要做优化,CSS提高性能的方法有哪些?
前端
dllxhcjla3 小时前
html初学
前端·javascript·html
只会写Bug的程序员3 小时前
【职业方向】2026小目标,从web开发转型web3开发【一】
前端·web3
LBuffer3 小时前
破解入门学习笔记题二十五
服务器·前端·microsoft
kuxku3 小时前
使用 SSE 与 Streamdown 实现 Markdown 流式渲染
前端·javascript·node.js
Sherry0073 小时前
【译】🔥如何居中一个 Div?看这篇就够了
前端·css·面试
前端小咸鱼一条3 小时前
18. React的受控和非受控组件
前端·react.js·前端框架