Lesson 7 of 14 · about 15 minutes · Exact colours like brands use them.
⚡ 0 XP
Step 1 of 2
Hex codes
Colour names like green are easy, but there are only about 140. For an exact colour, use a hex code: # followed by six digits for red, green and blue (00 = none, FF = full).
#FF9933 — India saffron
#FFFFFF — white
#138808 — India green
#000080 — navy blue (the Ashoka Chakra)
Shops and brands always use exact colours, so their logo looks the same everywhere.
Give each stripe its exact hex colour with background-color:
.saffron → #FF9933
.white → #FFFFFF
.green → #138808
Try twice to unlock the solution (0/2)
style.cssCtrl ⏎
Preview
Console
Output from console.log appears here.
Checklist
Press Run to check your code.
○
Saffron stripe is #FF9933
○
White stripe is #FFFFFF
○
Green stripe is #138808
Lesson notes (text version)
1. Hex codes
Colour names like green are easy, but there are only about 140. For an exact colour, use a hex code: # followed by six digits for red, green and blue (00 = none, FF = full).
#FF9933 — India saffron
#FFFFFF — white
#138808 — India green
#000080 — navy blue (the Ashoka Chakra)
Shops and brands always use exact colours, so their logo looks the same everywhere.