• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

css:切角效果

武飞扬头像
吃饭了吗
帮助1

一个切角

学新通

 <div class="main">
     <div class="box">切角效果</div>
 </div>
 <style>
     .box{
         width: 200px;
         height: 120px;
         padding: 10px;
         color: white;
         background: #58a;
         background: linear-gradient(-45deg, transparent 15px, #58a 0);
         
     }
 </style>

两个切角

学新通

 <div class="main">
     <div class="box">两个切角效果</div>
 </div>
 <style>
     .box {
         width: 200px;
         height: 120px;
         padding: 10px;
         color: white;
         background: #58a;
         background: linear-gradient(-45deg, transparent 15px, #58a 0) right,
             linear-gradient(45deg, transparent 15px, #58a 0) left;
         background-size: 50% 100%;
         background-repeat: no-repeat;
     }
 </style>
学新通

四个切角

学新通

 <div class="main">
     <div class="box">四个切角效果</div>
 </div>
 <style>
     .box {
         width: 200px;
         height: 120px;
         padding: 10px;
         color: white;
         background: #58a;
         background: linear-gradient(135deg, transparent 15px, #58a 0) top left,
             linear-gradient(-135deg, transparent 15px, #58a 0) top right,
             linear-gradient(-45deg, transparent 15px, #58a 0) bottom right,
             linear-gradient(45deg, transparent 15px, #58a 0) bottom left;
         background-size: 50% 50%;
         background-repeat: no-repeat;
     }
 </style>
学新通

弧形切角

学新通

 <div class="main">
     <div class="box">弧形切角</div>
 </div>
 <style>
     .box {
         width: 200px;
         height: 120px;
         padding: 10px;
         color: white;
         background: #58a;
         background: radial-gradient(circle at top left, transparent 15px, #58a 0) top left,
             radial-gradient(circle at top right, transparent 15px, #58a 0) top right,
             radial-gradient(circle at bottom right, transparent 15px, #58a 0) bottom right,
             radial-gradient(circle at bottom left, transparent 15px, #58a 0) bottom left;
         background-size: 50% 50%;
         background-repeat: no-repeat;
     }
 </style>
学新通

这篇好文章是转载于:编程之路

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 编程之路
  • 本文地址: /boutique/detail/tanhhachhf
系列文章
更多 icon
同类精品
更多 icon
继续加载