The color property changes text color. You can use named colors, hex codes, or rgb values.
CSS
Learn styling and layout for web pages.
Text Color
Run this example to see how it works and then try the exercise.
Click "Run" to see the example in action...Your task: Add a color property to make the h1 blue
Click "Run" to execute your code...Which property changes text color?
SUMMARY
In this section, you learned how to change text color. Next, you'll learn how to set background colors.
Background Color
background-color sets the element’s background color.
Run this example to see how it works and then try the exercise.
Click "Run" to see the example in action...Your task: Add a lightblue background-color
Click "Run" to execute your code...How do you set a red background?
SUMMARY
In this section, you learned how to set background colors. Next, you'll learn how to style fonts.
Font Properties
Control typography with font-size, font-weight, and font-family.
Run this example to see how it works and then try the exercise.
Click "Run" to see the example in action...Your task: Set font-size to 20px
Click "Run" to execute your code...Which unit is commonly used for font size?
SUMMARY
In this section, you learned how to style fonts. Next, you'll learn how to use selectors to target elements.
Unlock 10 More Lessons
You've completed the free preview! Upgrade to Pro to access all 12 lessons in this course, plus advanced projects and certificates.
- Selectors
- Box Model - Padding
- Box Model - Margin
- Borders
- Border Radius
- Width and Height
- Display Property
- Flexbox Basics
- Flexbox Alignment