Challenge - 5 Problems
Label and Placeholder Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
Why use
What is the main benefit of using a
Attempts:
2 left
💡 Hint
Think about users who rely on assistive technology.
✗ Incorrect
The
📝 Syntax
intermediate1:30remaining
Correct syntax for linking label to input
Which option correctly links a label to an input field with id='email'?
Attempts:
2 left
💡 Hint
The 'for' attribute in label must match the input's id.
✗ Incorrect
The label's 'for' attribute must exactly match the input's id to link them properly.
❓ rendering
advanced2:00remaining
Visual difference between placeholder and label
What will the user see when the input below is rendered in a browser?
<label for="name">Name:</label><input id="name" type="text" placeholder="Enter your full name">Attempts:
2 left
💡 Hint
Labels appear outside inputs; placeholders appear inside inputs as hints.
✗ Incorrect
The label is visible outside the input box, describing it. The placeholder text shows inside the input as a hint until the user types.
❓ selector
advanced1:30remaining
CSS selector for styling placeholder text
Which CSS selector correctly styles the placeholder text color to gray for all input fields?
Attempts:
2 left
💡 Hint
Look for the double colon syntax for pseudo-elements.
✗ Incorrect
The correct pseudo-element selector for placeholder text is ::placeholder.
❓ accessibility
expert2:00remaining
Accessibility issue with placeholder-only inputs
What is the main accessibility problem if a form input uses only a placeholder without a label?
Attempts:
2 left
💡 Hint
Think about how screen readers read form fields.
✗ Incorrect
Placeholders are not a replacement for labels because screen readers often ignore placeholders, causing confusion for users relying on assistive technology.