An Introduction to
Cascading Style Sheets
Naji
1
,What is CSS?
CSS stands for Cascading Style Sheets
Styles define how XHTML elements and markup should
be displayed by the browser (or user agent)
Styles can be included in the <head> area of an XHTML
document, or placed in external Style Sheet files.
Multiple style definitions are able to cascade into one…
2
, What’s a “Cascade”?
All styles will "cascade" into a new "virtual" style sheet in the
following rule order, where number four has the highest
priority:
1. Browser default
2. External style sheet
(<link rel="stylesheet" type="text/css" href="mystyle.css"
>)
3. Internal style sheet (inside the <head> tag) (<style> tag)
4. Inline style (inside an HTML element)
An inline style (inside an HTML element) with the highest
priority will override a style declared inside the <head> tag,
in turn overrides an external style sheet, which finally
overrides browser default values. 3
Cascading Style Sheets
Naji
1
,What is CSS?
CSS stands for Cascading Style Sheets
Styles define how XHTML elements and markup should
be displayed by the browser (or user agent)
Styles can be included in the <head> area of an XHTML
document, or placed in external Style Sheet files.
Multiple style definitions are able to cascade into one…
2
, What’s a “Cascade”?
All styles will "cascade" into a new "virtual" style sheet in the
following rule order, where number four has the highest
priority:
1. Browser default
2. External style sheet
(<link rel="stylesheet" type="text/css" href="mystyle.css"
>)
3. Internal style sheet (inside the <head> tag) (<style> tag)
4. Inline style (inside an HTML element)
An inline style (inside an HTML element) with the highest
priority will override a style declared inside the <head> tag,
in turn overrides an external style sheet, which finally
overrides browser default values. 3