curriculum/challenges/english/blocks/workshop-game-settings-panel/68e9a7bd60c971278d2d4ffc.md
In a previous lesson, you learned about pseudo-classes and pseudo-elements in CSS. You are going to apply that knowledge now by creating a combined type selector with pseudo-class selector.
First, start with the format for the type selector by setting it as input[type="checkbox"] and appending :checked to the end of it.
Next, give it a background-color with the value of #f1be32.
And lastly, set the border-color to have a value of #e2a60d.
You should have a combined type and pseudo-class selector of input[type="checkbox"]:checked.
assert.exists(new __helpers.CSSHelp(document).getStyle('input[type="checkbox"]:checked'));
You should add a background-color property to your combined type and pseudo-class selector of input[type="checkbox"]:checked.
assert.isNotEmpty(new __helpers.CSSHelp(document).getStyle('input[type="checkbox"]:checked')?.backgroundColor);
You should have a background-color property with a value of #f1be32.
assert.equal(new __helpers.CSSHelp(document).getStyle('input[type="checkbox"]:checked')?.backgroundColor, "rgb(241, 190, 50)");
You should add a border-color property to your combined type and pseudo-class selector of input[type="checkbox"]:checked.
assert.isNotEmpty(new __helpers.CSSHelp(document).getStyle('input[type="checkbox"]:checked')?.borderColor);
You should have a border-color property with a value of #e2a60d.
assert.equal(new __helpers.CSSHelp(document).getStyle('input[type="checkbox"]:checked')?.borderColor, "rgb(226, 166, 13)");
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Game Settings Panel</title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<div class="settings-card">
<h1>Game Settings</h1>
<label> <input type="checkbox" />Sound Effects</label>
<label> <input type="checkbox" />Background Music</label>
<label> <input type="checkbox" />Hard Mode</label>
<label> <input type="checkbox" />Haptic feedback</label>
</div>
</body>
</html>
body {
height: 100vh;
background-color: #f0f0f0;
text-align: center;
}
.settings-card {
max-width: 250px;
padding: 20px;
border-radius: 10px;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
margin: auto;
text-align: left;
}
h1 {
text-align: center;
}
label {
display: block;
cursor: pointer;
margin: 8px auto;
}
input[type='checkbox'] {
width: 20px;
height: 20px;
cursor: pointer;
appearance: none;
border: 2px solid #f1be32;
border-radius: 4px;
background-color: white;
transition: all 0.3s;
vertical-align: middle;
margin-right: 15px;
}
--fcc-editable-region--
--fcc-editable-region--