Challenge: Use Variables for Better CSS Management
Task
We are tasked with styling a blog web page. The objective is as follows:
- Define the color in the
:rootblock:- Create a variable named
--description-colorand assign it the value#9e6f21.
- Create a variable named
- Apply the
--description-colorvariable as a value of thecolorproperty to<p>elements with the class.description.
index.html
index.css
- Utilize
--followed by a descriptive name to create a variable, then set the:and assign it a value. - Assign the value
#9e6f21to the variable. - Employ
var(), and within the brackets, specify the variable name to use the variable as a property value.
index.html
index.css
Everything was clear?
Thanks for your feedback!
SectionΒ 1. ChapterΒ 10
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Suggested prompts:
Can you show me how to define a CSS variable in the :root block?
How do I apply the --description-color variable to the .description class?
Can you explain how to use var() in CSS?
Awesome!
Completion rate improved to 2.56
Challenge: Use Variables for Better CSS Management
Swipe to show menu
Task
We are tasked with styling a blog web page. The objective is as follows:
- Define the color in the
:rootblock:- Create a variable named
--description-colorand assign it the value#9e6f21.
- Create a variable named
- Apply the
--description-colorvariable as a value of thecolorproperty to<p>elements with the class.description.
index.html
index.css
- Utilize
--followed by a descriptive name to create a variable, then set the:and assign it a value. - Assign the value
#9e6f21to the variable. - Employ
var(), and within the brackets, specify the variable name to use the variable as a property value.
index.html
index.css
Everything was clear?
Thanks for your feedback!
SectionΒ 1. ChapterΒ 10