Check Box





<!DOCTYPE html>
<html>
<head>
<title>Check Box</title>
</head>
<body>

<div class="list">
<h2>CSS Only Item Check List</h2>
<label>
<input type="checkbox" name="">
<i></i>
<span>Lorem text is the dummy text for this site</span>
</label>

<label>
<input type="checkbox" name="">
<i></i>
<span>Lorem text is the dummy text for this site</span>
</label>

<label>
<input type="checkbox" name="">
<i></i>
<span>Lorem text is the dummy text for this site</span>
</label>

<label>
<input type="checkbox" name="">
<i></i>
<span>Lorem text is the dummy text for this site</span>
</label>

<label>
<input type="checkbox" name="">
<i></i>
<span>Lorem text is the dummy text for this site</span>
</label>
</div>

</body>
</html>

<style type="text/css">
*{
margin: 0px;
padding: 0px;
font-family: arial;
box-sizing: border-box;
}

body{
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #001925;
}
.list{
padding: 30px 75px 100px 30px;
position: relative;
background: #042b3e;
border-top: 50px solid #03a9f4;
}
.list h2{
color: #fff;
font-size: 30px;
padding: 10px 0px;
margin-left: 10px;
display: inline-block;
border-bottom: 4px solid #fff;
}
.list label{
position: relative;
display: block;
margin: 40px 0;
color: #fff;
font-size: 24px;
cursor: pointer;
}
.list input[type="checkbox"]{
-webkit-appearance:none;
}
.list i{
position: absolute;
top: 0px;
display: inline-block;
width: 25px;
height: 25px;
border: 2px solid #fff;
}
.list input[type="checkbox"]:checked ~ i{
top: 1px;
border-top: none;
border-right: none;
height: 15px;
width: 25px;
transform: rotate(-45deg);
}
.list span{
position: relative;
left: 40px;
transform: 0.5s;
}
/*done*/
.list span:before{
content: '';
position: absolute;
top: 50%;
left: 0px;
width: 100%;
height: 1px;
background: #fff;
transform: translateY(-50%) scaleX(0);
transform-origin: right;
transition: transform 0.5s;
}
.list input[type="checkbox"]:checked ~ span:before{
transform: translateY(-50%) scaleX(1);
transform-origin: left;
transition: transform 0.5s;
}

.list input[type="checkbox"]:checked ~ span:before{
color: #154e6b;
}
</style>

Comments

Popular posts from this blog

Right click disable

Moutain

Input Placeholder