Skip to content

CSS Animation – Black Button

HTML CODE:

<!DOCTYPE html>
<html>
<head>
    <title>check box-6</title>
    <link rel="stylesheet" type="text/css" href="1.page.css">
</head>
<body>
    <div  class="check">
        <input type="checkbox" name="">
    </div>

</body>
</html>

CSS CODE:

body{
    margin: 0;
    padding: 0;
    background: #292929;
}
.check{
    position: absolute;
    top:50%;
    left: 50%;
    transform: translate(-50%,-50%); 
}
input[type="checkbox"]{
    position: relative;
    width: 480px;
    height: 160px;
    -webkit-appearance:none;
    background: linear-gradient(0deg, #333, #000);
    outline: none;
    border-radius: 80px;
    box-shadow: 0 0 0 4px #353535,0 0 0 5px #3e3e3e, inset 0 0 10px black;
}
input:checked[type="checkbox"]{
    background: linear-gradient(0deg, #6dd1ff, #20b7ff);
    box-shadow: 0 0 0 4px #353535,0 0 0 5px #3e3e3e, inset 0 0 10px black;
}
input[type="checkbox"]:before{
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 360px;
    height:160px;
    background: linear-gradient(0deg, #000, #6b6b6b);
    border-radius: 80px;
    box-shadow: 0 0 0 1px #232323;
    transform: scale(.98,.96);
    transition: .5s;
}
input:checked[type="checkbox"]:before{
    left: 120px;
}
input[type="checkbox"]:after{
    content: "";
    position: absolute;
    top: 72px;
    left:300px;
    width: 16px;
    height: 16px;
    background: linear-gradient(0deg, #6b6b6b, #000);
    border-radius: 50%;
    transition: .5s;
}
input:checked[type="checkbox"]:after{
    background:#63cdff;
    left: 432px;
    box-shadow: 0 0 5px #13b3ff,0 0 15px #13b3ff; 
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: