Page 166 - CA_165_V2.0_Flipbook
P. 166
CASCADING STYLE SHEETS 4
'Cascading Style Sheet' is commonly referred to as CSS. CSS is a simple design language which
enables to simplify the process of making web pages. It handles and describes how an HTML web
page will be presented on a web browser. It helps to save lot of time as one design layout can be
used to make more number of web pages.
Using CSS, web designer can control the text colour, font style, paragraph spacing, columns size,
background images, layout designs, etc.
CSS SYNTAX AND SELECTORS
A CSS comprises of style rules that are interpreted by the web browser and then applied to the
corresponding elements in a document. Its style rule is made of two parts i.e., 'Selector' and
'Declaration'. 'Declaration' can be further categorised into 'Property' and 'Value'. Syntax is:
Selector {
Property1: Value1;
Property2: Value2;
Property3: Value3;
Where,
Selector: It signifies or points to an HTML tag to which a style will be applied. Selector could
be any tag like <H1>, <TABLE>, etc.
Property: It is a type of attribute (such as text colour, font style, paragraph spacing, etc.) of
HTML tag.
Value: It is the value assigned to the property. Value is always followed by 'Property' and
separated by 'colon'.
A CSS declaration block is enclosed by curly braces and always ends with a semicolon. Declaration
block can contain one or more declarations separated by a semicolon.
Selectors can be defined in various ways. Some of the selectors are illustrated below:
Type Selector
H1{color:blue}
Here, H1 is the selector and 'color' is a CSS property. In this case, all elements of H1 will appear in
blue colour. Let us take another example:
P {
text-align: center;
164 Touchpad Computer Applications-X

