Back to Freecodecamp

Step 12

curriculum/challenges/english/blocks/workshop-game-settings-panel/68f29753fd5524530c6e65c8.md

latest2.4 KB
Original Source

--description--

Next, set a vertical-align property with a value of middle.

The vertical-align property controls how inline or inline-block elements align vertically with the surrounding text or other inline elements. It's often used to adjust the vertical position of elements like images, icons, or text within a line.

Then finalize your checkbox with a margin property of 15px.

--hints--

You should add a vertical-align property to your input[type="checkbox"] selector.

js
assert.isNotEmpty(new __helpers.CSSHelp(document).getStyle('input[type="checkbox"]')?.verticalAlign);

You should have a vertical-align property with a value of middle.

js
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('input[type="checkbox"]')?.verticalAlign, "middle");

You should add a margin-right property to your input[type="checkbox"] selector.

js
assert.isNotEmpty(new __helpers.CSSHelp(document).getStyle('input[type="checkbox"]')?.marginRight);

You should have a margin-right property with a value of 15px.

js
assert.strictEqual(new __helpers.CSSHelp(document).getStyle('input[type="checkbox"]')?.marginRight, "15px");

--seed--

--seed-contents--

html
<!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>
css
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;
--fcc-editable-region--
  
--fcc-editable-region--
}