Challenge - 5 Problems
HSL Color Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
Understanding HSL Color Components
Which part of the HSL color
hsl(120, 50%, 50%) controls the brightness of the color?Attempts:
2 left
💡 Hint
Think about which value changes how light or dark the color looks.
✗ Incorrect
In HSL, the Lightness value controls how bright or dark the color appears. A higher lightness means a lighter color, and a lower lightness means a darker color.
📝 Syntax
intermediate1:30remaining
Correct HSL Syntax
Which CSS rule correctly sets the background color to a semi-transparent green using HSL with 50% opacity?
Attempts:
2 left
💡 Hint
Look for the correct function name and number of parameters.
✗ Incorrect
The hsla() function includes an alpha (opacity) value as the fourth parameter. The hsl() function does not accept a fourth parameter.
❓ rendering
advanced2:00remaining
Visual Result of HSL Color
What color will the following CSS produce as background?
background-color: hsl(0, 100%, 50%);
Attempts:
2 left
💡 Hint
Hue 0 degrees corresponds to which color on the color wheel?
✗ Incorrect
Hue 0 degrees in HSL corresponds to red. Saturation 100% and Lightness 50% produce a bright, pure red.
❓ selector
advanced2:00remaining
Selecting Elements by HSL Color in CSS
Which CSS selector will select all elements with a background color exactly set to
hsl(240, 100%, 50%)?Attempts:
2 left
💡 Hint
Look for a selector that matches any style attribute containing the exact substring.
✗ Incorrect
The attribute selector [style*='...'] matches elements whose style attribute contains the given substring anywhere. This works for inline styles with that background color.
❓ accessibility
expert2:30remaining
Ensuring Text Contrast with HSL Colors
You set a background color using
hsl(200, 70%, 40%). Which text color choice ensures good contrast and accessibility?Attempts:
2 left
💡 Hint
For good contrast, text should be much lighter or darker than the background.
✗ Incorrect
The background is dark (40% lightness). To ensure readable text, choose a light color (90% lightness) for the text. Colors with similar lightness values reduce readability.