search

Home  >  Q&A  >  body text

css3 - 这个右下角折角用css怎么画出来?

这种折角用css怎么画出来啊,右下角那个?

黄舟黄舟2863 days ago732

reply all(4)I'll reply

  • 天蓬老师

    天蓬老师2017-04-17 11:38:47

    This can be achieved through the pseudo-class border-color.

    HTML

    <p class="bg">
        <p class="paper"></p>
    </p>

    CSS

    .bg{
        padding:10px;
        background: #262a67
    }
    .paper{
        background:#00b5e9;
        width:500px;
        height:500px;
        position: relative;
    }
    
    .paper:before{
        content:"";
        position: absolute;
        right:0;
        bottom:0;
        display: block;
        border: 50px solid;
        border-color:#0095be transparent transparent #0095be;
    }
    
    .paper:after{
        content:"";
        position: absolute;
        right:0;
        bottom:0;
        display: block;
        border: 50px solid;
        border-color:transparent #262a67 #262a67 transparent ;
    }

    If the background is not a solid color, you need to split the folding page into rectangular strips and folding triangles. This can also be achieved through pseudo-classes.
    It is only provided for reference. The specific implementation needs to be modified as needed.

    HTML

    <p class="paper"></p>

    CSS

    .paper{
        width:500px;
        height:500px;
        position: relative;
        background:#00b5e9;
    }
    
    .paper:after{
        content:"";
        position: absolute;
        right:0;
        bottom:-100px;
        display: block;
        border: 50px solid;
        border-color:#0095be transparent transparent #0095be;
    }
    
    .paper:before{
        content:"";
        background:#00b5e9;
        width:400px;
        height:100px;
        position: absolute;
        bottom:-100px;
    }
    

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 11:38:47

    You can use Baidu to search for CSS3 corners

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-17 11:38:47

    I implemented it by using three p's. A square p includes two triangle p's, and then it is positioned by position. . .

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 11:38:47

    hover.css http://ianlunn.github.io/Hover/ has this effect, the corner is folded using gradient color

    Other ideas can be to use border-width to simulate a triangle and then position it there

    reply
    0
  • Cancelreply