Multiple Style Sheets
If some properties have been set for the same selector in different style sheets, the values will be inherited from the more specific style sheet. For example, an external style sheet has these properties for the h3 selector as the top code. |
|
And an internal style sheet has these properties for the h3 selector as the middle code. If the page with the internal style sheet also links to the external style sheet the properties for h3 will be the bottom code. |
|
The color is inherited from the external style sheet and the text-alignment and the font-size is replaced by the internal style sheet. |
|
<head>
element, or in an external CSS file.
Even multiple external style sheets can be referenced inside a single HTML document.
What style will be used when there is more than one style specified?
All the styles will “cascade” into a new “virtual” style sheet by the following rules, where number four has the highest priority:
<head>
tag)<head>
tag, in an external style sheet, or in a browser (a default value).