CSS
Colors and Units
Styling TextNow that you know how to select elements, let’s make them look better by changing colors and controlling their size. These are two of the most common things you’ll do in CSS, so it’s important to understand them clearly.
Colors in CSS
There are a few different ways to write colors in CSS. Let’s go through them one by one.
Named colors
CSS has a list of built-in color names you can use, like red, blue, or green.
h1 {
color: red;
}This makes all <h1> text red. You can see all the colors from THIS PAGE HERE
Hex codes
A hex code starts with # and is followed by six characters. These characters are made from numbers 0–9 and letters A–F.
Members only
Keep reading this lesson
You've reached the end of the free preview. Unlock the rest of this lesson plus 12 more lessons in CSS.
- Unlimited coding questions
- Unlimited access to all classroom material
- Weekly live call for questions and guidance
- 3,000 AI tutor tokens / month
- Personal SQL database (3 MB)
- Progress tracking
Cancel any time.