In this tutorial we will see how to design Pure CSS Button with Folded Corner. Simple CSS is used for this purpose, HTML code and CSS code is given.
Table of Contents
HTML Code
HTML Code is given below, in this we have container div with HTML button inside.
<div>
<button class="btn">Click Me</button>
</div>
CSS Code
CSS Code is given below, in this code we have used CSS ::before selector and CSS clip-path property to create the folded corner effect.
*
{
font-family: 'Barlow Condensed',sans-serif;
}
body
{
margin: 0;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
background-color: #9CC2D9;
}
.btn
{
position: relative;
padding: 10px 50px;
font-size: 30px;
font-weight: bold;
background-color: #372594;
color: #ddd;
border: 0px;
border-radius: 4px;
cursor: pointer;
transition: 0.5s;
clip-path: polygon(10% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 30%);
}
.btn::before
{
content: '';
position: absolute;
width: 20px;
height: 20px;
background-color: #6855C9;
left: -2px;
top: -3px;
border-bottom-right-radius: 5px;
box-shadow: 1px 1px 2px 0px #22146E;
transition: 0.5s;
}
.btn:hover::before
{
width: 0px;
height: 0px;
}
.btn:hover
{
clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 0%);
}
Demo
Video Tutorial
Watch our video tutorial on Pure CSS Button with Folded Corner.