- index.html
- style.css
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<title>Toggle switches, step 4</title>
<meta charset="utf-8">
<link rel="stylesheet" href="material.css">
<link rel="stylesheet" href="style.css">
</head>
<body class="green-theme">
<section class="card">
<h1 class="question"><span>What tags have never been included as part of HTML?</span></h1>
<form class="answers" action="https://echo.htmlacademy.ru/courses" method="post">
<button class="fab" type="submit"></button>
<div>
<input type="checkbox" id="answer1">
<label for="answer1">nextid</label>
</div>
<div>
<input type="checkbox" id="answer2">
<label for="answer2">bgsound</label>
</div>
<div>
<input type="checkbox" id="answer3">
<label for="answer3">hole</label>
</div>
</form>
</section>
</body>
</html>
CSS
label {
position: relative;
display: inline-block;
max-width: 100px;
word-wrap: break-word;
cursor: pointer;
}
label::before,
label::after {
position: absolute;
display: block;
content: "";
}
label::before {
top: 7px;
left: 108px;
width: 32px;
height: 1px;
border-top: 1px solid #5a5a5a;
}
label::after {
top: 0;
left: 100px;
width: 12px;
height: 12px;
border: solid 2px #5a5a5a;
border-radius: 50%;
background-color: #ffffff;
}
input[type="checkbox"] {
display: none;
}
input[type="checkbox"]:checked ~ label::after {
}
You’ve gone to a different page
Goalscompleted
0
- For the activate state of the slider, assign the
translateX(32px)
movement transform, - and also set a background and border color of
#0f9d58
. - And then in the
label::after
rule, assign a transition for all200ms
duration properties with anease-in
form.
Click the toggle switches to test the result.
- Select the correct answer to the quiz question, and press the round button to check your answer.
Comments