CSS TutorialLesson #9
Multiple Style Sheets
If some properties have been defined for the same selector (element) in different style sheets,
If some properties have been defined for the same selector (element) in different style sheets, the value from the last read style sheet will be used.
Example
Example Code
cssh1
{
color: navy;
}Example
Example Code
cssh1
{
color: orange;
}Example
Example Code
htmlLive Output Preview:
Example
Example Code
htmlLive Output Preview:
Cascading Order
What style will be used when there is more than one style specified for an HTML element?
All the styles in a page will "cascade" into a new "virtual" style sheet by the following rules, where number one has the highest priority:
- Inline style (inside an HTML element)
- External and internal style sheets (in the head section)
- Browser default
So, an inline style has the highest priority, and will override external and internal styles and browser defaults.
Interactive Code Examples
CSS Example 3
htmlInteractive runnable CSS example from EA Academy.
Live Output Preview:
CSS Example 4
htmlInteractive runnable CSS example from EA Academy.
Live Output Preview: