Page 32 - modular_v2.0_HTML&_CSS_Fb
P. 32
3 CASCADING
STYLE SHEETS
Your Aim
to learn about:
l Selectors l Types of CSS
l Background Color Property l Border Properties
l Margin Properties l Height and Width Properties
l Outline Properties l Font Properties
l Text Align Property l Float Property
'Cascading Style Sheet' is commonly referred to as CSS. It is a simple design language which
enables to simplify the process of making web pages. It handles and describes how a HTML web
page will be presented on a web browser. It saves a lot of time as one design layout can be used
to make more number of web pages.
Using CSS, a web designer can control the text colour, font style, paragraph spacing, column size,
background images, layout designs, etc.
SELECTORS
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: Selector {Property:Value}
Selector: It signifies or points to the HTML element, to which a style will be applied. Selector
could be any tag like <H1>, <TABLE>, etc.
Property: The property is the style you want to change. It tells the browser which part of
the element you want to adjust, like the colour, size, or margin.
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 listed below:
Universal Selector
It selects all elements on the web page.
30
Touchpad MODULAR (Ver. 2.0)

