Page 189 - CA_165_V2.0_Flipbook
P. 189
6. Write the names of the CSS properties used in the following:
i. HELLO ii. CSS
iii. BE HAPPY!! iv. HELLO WORLD
Ans. 6. i. Border-style, border-width, background-color
ii. font-family, color
iii. border-style, outline-width, outline-color, outline-style, text-align
iv. font-family, font-style
7. Name the CSS margin property that is used to set the right margin of an element.
Ans. 7. margin-right.
8. Which link style sheet is commonly used when a web page has a unique style?
Ans. 8. internal style sheet
B. Long answer type questions.
1. What is CSS? Discuss the components of a CSS style rule using an example.
Ans. 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. Using CSS, web
designer can control the text colour, font style, paragraph spacing, columns size, background images,
layout designs, etc.
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'.
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>
Cascading Style Sheets 187

