天蓬老师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;
}
大家讲道理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. . .
怪我咯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