HTML & CSS · Senior · Question 2 of 75

How do normal (non-!important) layered and unlayered styles rank against each other?

Explanation

Unlayered styles implicitly go into a "last" layer and beat all named layers. That lets you wrap third-party CSS in @layer vendor and easily override it with your own styles. With !important the logic flips: important layered styles beat important unlayered ones.

Further reading

Problem with a question

HTML & CSS · Senior · question 2

Test yourself

Take the HTML & CSS · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz