2. Objectives
Students should able to:
1. How to load html text and cascading
style sheets.
2. Apply style sheets in HTML
documents.
3. Style Sheet
Any style sheet language may be used
with HTML.
The syntax of style data depends on the
style sheet language.
Use the META element to set the default
style sheet language for a document.
4. Style Sheet
Author should put the following declaration
in the HEAD of their document when using
Cascading Style Sheet (CSS):
<META http-equiv="Content-Style-Type"
content="text/css">.
5. Why use Style Sheet?
Style sheets make it easy to specify:
• the amount of white space between
text lines,
• the amount lines are indented,
• the colours used for the text and the
backgrounds,
• the font size and style, and
• a host of other details.
6. Why use Style Sheet?
For example:
P.special {
color : green;border: solid red;
}
This sets the text colour of a paragraph to
green and surrounds it with a solid red
border.
7. Types of Style Sheet
1. Flexible placement of style information:
Placing style sheets in separate files
makes them easy to reuse.
It is useful to include rendering
instructions within the document to at
the start of the document to make it
easier to manage style.
8. Types of Style Sheet
2. Cascading
Capability provided by CSS to allow style
information from several sources to be
blended together.
The cascade defines an ordered sequence of
style sheets where rules in later sheets have
greater precedence than earlier ones.