4.4 Understanding CSS Selectors and IDs Quiz

Last updated about 1 year ago
5 questions
1

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

1

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

1

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

1

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?

1

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