• CSS 折角效果


    效果1

     
    .folded-corner{
        width: 200px;
        height: 200px;
        margin-bottom: 20px;
        background: #58a; /* Fallback */
        background:
        linear-gradient(-135deg, transparent 2em, #58a 0);
    }

    效果二, 效果一的基础上加上以下样式

     
    .fc-2{
      background:
        linear-gradient(to left bottom,
        transparent 50%, rgba(0,0,0,.4) 0)
        no-repeat 100% 0 / 2em 2em,
        linear-gradient(-135deg, transparent 1.428em, #58a 0);
    }

    效果三    非45度角(效果一的样式加以下代码)

     
    .fc-3,.fc-4{
      position: relative;
      background:
        linear-gradient(-150deg, transparent 1.5em, #58a 0);
    }
    
    .fc-3:before,.fc-4:before{
      content: '';
      display: block;
      position: absolute;
      right: 0;
      top: 0;
      width: 1.73em;
      height: 3em;
       background: linear-gradient(to left bottom,transparent 50%, rgba(0,0,0,.4) 0) 100% 0 no-repeat;
      transform: translateY(-1.3em) rotate(-30deg);
      transform-origin: bottom right;
    }

    效果四 效果三的基础上加上以下代码

     
    .fc-4{
      border-radius: 5px;
    }
    
    .fc-4:before{
      border-bottom-left-radius: inherit;
      background: linear-gradient(to left bottom,transparent 50%, rgba(0,0,0,.2) 0, rgba(0,0,0,.4)) 100% 0 no-repeat;
      box-shadow: -.2em .2em .3em -.1em rgba(0,0,0,.15);
    }

    更多参考链接http://www.w3cplus.com/css3/css-secrets/folded-corner-effect.html

  • 相关阅读:
    Pyhton学习——Day60
    Pyhton学习——Day58
    Python——微信数据分析
    C/C++文件指针偏移
    I/O流+统计文件词频
    vector概念
    new/delete工作机制
    Singleton单例类模式
    对象数组
    特殊成员函数
  • 原文地址:https://www.cnblogs.com/lisa-lin/p/5541826.html
Copyright © 2020-2023  润新知