HTML TutorialLesson 12Free preview
HTML Colors
This lesson is part of HTML · All levels
Summary
The color in HTML can be expressed in three ways: color names such as red, hexadecimal codes such as #ff0000, or functions such as rgb(255, 0, 0) and hsl(). The color is usually applied via the CSS color property for text and background-color for background. Contrasting color selection is also important to keep text easy to read.
Key points
- Three ways to write color: name, hexadecimal, and (#rrggbb)
- Color set the color text, background-color set the color background
- hexadecimal is composed of pairs of red, green, and blue values
- Make sure the contrast between text and background is enough to make it easy to read
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.