0
0
CSSmarkup~30 mins

HSL colors in CSS - Mini Project: Build & Apply

Choose your learning style9 modes available
Using HSL Colors in CSS
📖 Scenario: You are creating a simple webpage with colorful sections. You want to use HSL colors to style the background and text colors because HSL lets you easily adjust hue, saturation, and lightness.
🎯 Goal: Build a CSS stylesheet that uses HSL colors to style a webpage with a header, main content, and footer. Each section should have a distinct background color using HSL, and the text color should also use HSL for good contrast.
📋 What You'll Learn
Use HSL color values for background colors in header, main, and footer sections.
Use HSL color values for text colors in each section.
Choose different hues for each section to show color variety.
Adjust saturation and lightness to ensure text is readable on backgrounds.
Write clean, valid CSS code.
💡 Why This Matters
🌍 Real World
Web designers often use HSL colors because they make it easy to adjust colors by changing hue, saturation, or lightness. This helps create consistent and accessible color schemes.
💼 Career
Knowing how to use HSL colors in CSS is important for front-end developers and designers to build visually appealing and accessible websites.
Progress0 / 4 steps
1
Create basic CSS selectors for page sections
Write CSS rules for the selectors header, main, and footer with no styles yet. Just create empty blocks for each selector.
CSS
Need a hint?

Start by writing the selectors header, main, and footer with curly braces.

2
Add HSL background colors to each section
Add a background-color property to header, main, and footer using these exact HSL values: header uses hsl(200, 70%, 50%), main uses hsl(120, 60%, 70%), and footer uses hsl(340, 80%, 60%).
CSS
Need a hint?

Use the background-color property with the exact HSL values given for each section.

3
Add HSL text colors for good contrast
Add a color property to header, main, and footer using these exact HSL values: header uses hsl(0, 0%, 95%), main uses hsl(0, 0%, 30%), and footer uses hsl(0, 0%, 10%).
CSS
Need a hint?

Use the color property with the exact HSL values given for each section's text color.

4
Add padding and font styles for better appearance
Add padding: 1.5rem and font-family: Arial, sans-serif to header, main, and footer to improve spacing and text style.
CSS
Need a hint?

Add padding: 1.5rem and font-family: Arial, sans-serif inside each section's CSS block.