Question With css and selectors exercise 8


#1

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/courses/learn-css-selectors-visual-rules/lessons/css-setup-selectors/exercises/multiple-classes?action=lesson_resume&course_redirect=learn-css

im not having problems, just a question. The exercises asks us to create a multiple class attribute by creating a “title uppercase” within one class attribute. i don’t really understand what the purpose of this is, why can’t i just utilize the singular .title class by itself and just apply all the styling within that .title class instead of creating .title and .uppercase?
It’s the same end result for both paths in regards to styling, sorry i am just confused.



 **<h1 class="title uppercase">Top Vacation Spots</h1>**
**  <h5>By: Stacy Gray</h5>**
**  <h6>Published: 2 Days Ago</h6>**

**.title {**
**  color: teal;**
**}**

**.uppercase {**
**  text-transform:uppercase;**
**}**


Why can't i just do

<h1 class="title"> Top Vacation spots </h1>

.title {
Color:Teal;
Text-Transform:uppercase;
}

#2

for this scenario yes, but you might want to give other elements a uppercase, but not a teal color, so having a separate class can have its advantage.

The trick is always to balance this things, when should you use two classes or one class with all the rules? This depends on the rest of your intention/design of your program


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.