0
0
CSSmarkup~20 mins

Hex colors in CSS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Hex Color Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Hex Color Codes
What color will the CSS rule color: #FF0000; produce when applied to text?
ABlack
BBright green
CBright red
DBright blue
Attempts:
2 left
💡 Hint
The first two digits in a hex color code represent the red component.
📝 Syntax
intermediate
2:00remaining
Valid Hex Color Syntax
Which of the following CSS hex color codes is invalid and will cause the browser to ignore the color?
A#12G45F
B#FFF
C#123ABC
D#000000
Attempts:
2 left
💡 Hint
Hex digits can only be 0-9 and A-F.
rendering
advanced
2:00remaining
Visual Result of Short Hex Color
What color will the CSS rule background-color: #0F0; produce on a webpage?
ABright red
BBright green
CBright blue
DDark gray
Attempts:
2 left
💡 Hint
Short hex colors repeat each digit to form the full 6-digit code.
selector
advanced
2:00remaining
CSS Selector and Hex Color Application
Given the CSS rule p.highlight { color: #800080; }, what color will the text inside a paragraph with class highlight be?
CSS
<p class="highlight">Sample text</p>
APurple
BOrange
CTeal
DYellow
Attempts:
2 left
💡 Hint
The hex code #800080 is a common purple color.
accessibility
expert
2:00remaining
Hex Color Contrast for Accessibility
Which hex color combination provides the best contrast for text readability on a white background?
AText color: #FF0000 (bright red)
BText color: #777777 (medium gray)
CText color: #CCCCCC (light gray)
DText color: #000000 (black)
Attempts:
2 left
💡 Hint
High contrast means very different brightness between text and background.