Page 132 - CA 165 ver 1.0 Class 10
P. 132
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 categorized into ‘Property’ and ‘Value’.
Example: H1{COLOR:BLUE}
Here, H1 is the Selector and Blue is value of the Selector COLOR is Property
Selector: It signifies or point 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’.
2. Explain in detail the methods to link a style sheet document to a webpage.
Ans. There are three ways of inserting or linking a style sheet: External Style Sheet, Internal Style Sheet and
Inline Style. By using ‘External Style Sheet’, look of an entire website can be changed by updating just one
CSS file. To do so:
Web page must include a reference to the external style sheet file within a <link> element inside the
<HEAD> section.
Syntax to define LINK in the web page:
<HEAD>
<LINK REL=“stylesheet” TYPE=“text/css” HREF=“name of style sheet”>
</HEAD>
CSS design can also be applied into an HTML document by using <STYLE> tag. This tag should be placed
inside the <HEAD>...</HEAD> tags. An internal style sheet is commonly used when one web page has a
unique style.
An inline style is used to apply a unique style for a single element. The syntax to use inline style is as follows:
<element style = “...style rules....”>
3. Discuss the different CSS outline properties.
Ans. An outline is a line that is drawn around elements, to make the element “stand out”. Outline differs from
borders as it is drawn outside the element’s border, and may overlap other content. CSS has the following
outline properties:
‘outline-width’ property is used to set the width of the outline.
‘outline-style’ property is used to set the style of line for the outline and can have values like Dotted,
Dashed, Solid, Double, Groove, Ridge, Inset, Outset, None, Hidden, etc.
‘outline-color’ property is used to set the color of the outline.
‘outline-offset’ property is used to add space between an outline and the edge/border of an element.
The space between an element and its outline is transparent.
‘outline’ property is used to set the above three properties in a single statement.
4. Explain the CSS font properties that can be used to stylize the text.
Ans. CSS font property is used to define the font, size and the style of the text. Some of the commonly used
font properties are font-family, font-style, font-size, etc.
The font-family property is used to change the face of the font.
The ‘font-style’ property is mostly used to make the text ‘italic’. Other types of font styles are normal
and oblique.
The ‘font-size’ property is used to increase or decrease the size of a font.
<P STYLE=“font-family:verdana; font-style:italic; font-size: 12px;”>
The space between an element and its outline is transparent.
</P>
130 Touchpad Computer Applications-X

