0
0
CSSmarkup~20 mins

HSL colors in CSS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
HSL Color Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding HSL Color Components
Which part of the HSL color hsl(120, 50%, 50%) controls the brightness of the color?
A50% (Lightness)
B50% (Saturation)
CNone of these
D120 (Hue)
Attempts:
2 left
💡 Hint
Think about which value changes how light or dark the color looks.
📝 Syntax
intermediate
1:30remaining
Correct HSL Syntax
Which CSS rule correctly sets the background color to a semi-transparent green using HSL with 50% opacity?
Abackground-color: hsla(120, 100%, 50%);
Bbackground-color: hsl(120, 100%, 50%, 0.5);
Cbackground-color: hsla(120, 100%, 50%, 0.5);
Dbackground-color: hsl(120, 100%, 50% / 0.5);
Attempts:
2 left
💡 Hint
Look for the correct function name and number of parameters.
rendering
advanced
2:00remaining
Visual Result of HSL Color
What color will the following CSS produce as background?
background-color: hsl(0, 100%, 50%);
ABright green
BBright red
CBright blue
DBright yellow
Attempts:
2 left
💡 Hint
Hue 0 degrees corresponds to which color on the color wheel?
selector
advanced
2: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%)?
A[style$='background-color: hsl(240, 100%, 50%)']
B[style='background-color: hsl(240, 100%, 50%)']
C[style^='background-color: hsl(240, 100%, 50%)']
D[style*='background-color: hsl(240, 100%, 50%)']
Attempts:
2 left
💡 Hint
Look for a selector that matches any style attribute containing the exact substring.
accessibility
expert
2: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?
Ahsl(200, 70%, 90%)
Bhsl(200, 70%, 50%)
Chsl(200, 70%, 40%)
Dhsl(200, 70%, 30%)
Attempts:
2 left
💡 Hint
For good contrast, text should be much lighter or darker than the background.