Colours in HTML and CSS can be written in several ways:
Names: tomato, navy, teal (about 140 names are supported).
HEX: #RRGGBB, e.g. #2563EB.
RGB: rgb(37, 99, 235), each value from 0 to 255.
RGBA: adds transparency, e.g. rgba(37, 99, 235, 0.5).
HSL: hue, saturation, lightness, e.g. hsl(221, 83%, 53%).
💡 Key Takeaways: HTML Colors
Mastering HTML Colors helps you write clean and reliable HTML code. Follow standard conventions, test edge cases, and keep logic simple. Try running the code example below and complete the exercises to build confidence.