CSS
CSS stands for Cascading Style Sheets. CSS is used to refine the refine the presentation of a web page. CSS allows us to set the properties for HTML elements using a large collection of values. It has more than 100 properties, and is an advanced tool for web designers to create professional web sites that cannot be made using regular HTML attributes.
A style sheet is a set of rules. To define a rule, a selector and a declaration is used.
The selector is used to choose which elements would use the settings defined by the declaration.
A declaration has the syntax:
property_name : property_value
where the property_name is a reserved word that defines a property and the property_value is a valid value for that property.
Examples :-
font-size : 14pt; used to set the size of the text to 14 pt
font-style : italic; used to set the style of the text to italic style
cursor : move; used to set the mouse pointer to the move style
text-decoration : none; used to eliminate any decoration of the text
Declaration Blocks :-
A declaration block is a list of declarations separated by semi-colons (;) and included in a { ….. } block. Here are some examples of declaration blocks:
{font-size : 12pt; font-style : italic;}
{background : yellow;}
{text-decoration : none; cursor : move;}
The Type Selector :-
To define a rule, a selector is used, followed by a declaration block.
For example, the following code defines a rule for rendering all elements using a 12 pt, italic font. Hence it applies to any
element.
p {font-size : 12pt; font-style : italic;}
Style Sheets :-
Many rules can be added to define a style sheet. For example, the following fragment represents a style sheet:
p {font-size : 12pt; text-transform : uppercase;}
h3 {font-style : italic; background : yellow;}
div {color : red; font-size : 10pt;}
img {cursor : move;}
Attachments
CSS - Cascading Style Sheets (34102-161154-CSS.doc)CSS - Cascading Style Sheets (34102-161155-CSS.doc)