Am I doing anything wrong in using
:checked
?
I want to make a multiplication sign but I don’t know why this transform isn’t working.
.checkbox:checked.custom-box::after{
transform: rotate(45deg);
}
The HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Nav Toggle</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<lable class="lable">
<input type="checkbox" class="checkbox">
<span class="custom-box"></span>
</lable>
</body>
</html>
And THE CSS
body{
display: grid;
place-items: center;
height: 100vh;
background-image: url(img.jpg);
background-size: cover;
}
.checkbox{
background-color: #fff;
position: relative;
left: 2.75rem;
bottom: 0.2rem;
cursor: pointer;
transform: scale(15,8);
z-index: 0;
opacity: 1;
}
.checkbox:checked.custom-box::after{
transform: rotate(45deg);
}
.custom-box{
display: inline-block;
background-color: #ff0000;
width: 10rem;
height: 20px;
position: relative;
left: -50px;
top: 0px;
}
.custom-box::after{
content: "";
width: 10rem;
height: 20px;
background-color: #ff0000;
position: absolute;
bottom: 1.8rem;
left: 0px;
}
.custom-box::before{
content: "";
width: 10rem;
height: 20px;
background-color: #ff0000;
position: absolute;
top: 1.8rem;
left: 0px;
}