首页 > Web开发 > 详细

css 折角效果/切角效果

时间:2019-04-03 14:58:17      阅读:129      评论:0      收藏:0      [点我收藏+]

首先我们先创建一个图案为100像素的斜面切角的图案

html

<div class="one">12345</div>

css

.one{
    width: 100px;
    height: 100px;
    margin: 0 auto;
    background: yellowgreen;
    background: linear-gradient(-135deg,transparent 15px ,yellowgreen 0 );
  }

效果图

技术分享图片

然后我们在生成一个我们需要的折角三角形

css

.one{
    width: 100px;
    height: 100px;
    margin: 0 auto;
    border: 1px solid red;
    background: linear-gradient( to left bottom ,transparent 50%,rgba(0,0,0,.4) 0 )no-repeat 100% 0 / 15px 15px ;
  }

效果图

技术分享图片

最后我们只需要合并一下就可以得出我们想要的折角效果

css

.one{
    width: 100px;
    height: 100px;
    margin: 0 auto;
    background: yellowgreen;
    background: linear-gradient( to left bottom ,transparent 50%,rgba(0,0,0,.4) 0 )no-repeat 100% 0 / 15px 15px,
    linear-gradient(-135deg,transparent 10.5px ,yellowgreen 0 );
  }

效果图

技术分享图片

 

css 折角效果/切角效果

原文:https://www.cnblogs.com/yhhBKY/p/10648758.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!