Location Priorities
In this lesson, we shall explore the nature and usage of location properties.
We'll cover the following
If the winner rule cannot be selected by the highest priority, and even the selectivity of the competing rules does not lead to a decision, the last step uses the priority of the rule’s location to get the winner.
The six key location priorities #
The decision is made by the six location priorities, as listed here from the highest to the lowest:
-
The first priority location is the
<style>
element in the head of the HTML document. -
The second priority location is a style sheet imported by an
@import
at-rule embedded within the<style>
element -
The third priority location is a style sheet attached by a
<link>
element. -
The fourth priority location is a style sheet imported by an
@import
at-rule embedded within a style sheet attached by a<link>
element. -
The fifth priority location is a style sheet attached by an end-user. An exception is made for
!important
rules in an end-user style sheet. These rules are given the highest priority. -
And last, the sixth (lowest) priority location is the default style sheet supplied by a browser.
Get hands-on with 1200+ tech skills courses.