Log in
Sign up for FREE
arrow_back
Library

4.4 Understanding CSS Selectors and IDs Quiz

star
star
star
star
star
Last updated over 1 year ago
5 questions
1
1
1
1
1
Question 1
1.

Why is selecting by ID considered more specific than selecting by class or tag in CSS?

Question 2
2.

If an HTML element has both a class and an ID assigned to it, which style will take precedence if there is a conflict?

Question 3
3.

What is a valid way to name an ID in CSS?

Question 4
4.

Consider the following CSS rules:
`p { color: green; }`
`.alert { color: red; }`
`#logo { color: blue; }`
If an element has the class "alert" and the ID "logo," what color will the text be?

Question 5
5.

Which of the following statements about CSS ID selectors is true?