1732606097011.AS - WS - G7 - CH 5 - Using CSS in HTML
1732606097011.AS - WS - G7 - CH 5 - Using CSS in HTML
a. property b. value
c. declaration d. selector
iv. Which of the following correctly links to an external style sheet? [U]
href="style1.css"/> href="style1.css"/>
v. What is the correct CSS statement to make the background colour of all [U]
paragraph elements blue?
Pg no. 1
5. Using CSS in HTML
a. b. p {background-color :
p {background-color : blue;}
#blue;}
#blue;}
i. Observe the following CSS codes and answer the given questions. [Ap]
CSS
b. Which CSS code is used to apply a style to only a single and unique
c. Which code uses class names to find HTML elements for applying
formatting?
ii. What is the primary purpose of CSS in web development? How does it [U]
Ans: CSS stands for cascading style sheet. It is used to style HTML
Pg no. 2
5. Using CSS in HTML
iii. Reena has created a website containing more than ten web pages. She [Ap]
needs to use CSS for styling the web pages. Which type of style sheet
Ans: An external style sheet allows Reena to define styles in a single file
and maintain consistency across all her web pages. This is
particularly beneficial for maintaining a uniform look and feel
throughout the entire website.
iv. Write the HTML code using internal stylesheet to get the following [An]
output.
Ans: <html>
<head>
<style>
p.uppercase {
text-transform: uppercase;
}
p.lowercase {
text-transform: lowercase;
}
p.capitalize {
text-transform: capitalize;
}
</style>
</head>
<body>
<p class=uppercase>My name is Rohan. </p>
<p class=lowercase> My name is Rohan. </p>
<p class=capitalize> My name is Rohan. </p>
Pg no. 3
5. Using CSS in HTML
</body></html>
v. Write the CSS code used to display the image ‘flower.jpg’ in the [Ap]
background of a web page as shown in the given image.
Ans: body
{
background-image: url(“flower.jpg” );
background-repeat: no-repeat;
background-position: right bottom;
}
Lab Activity
1. Create a web page containing information on “ Vasudhaiva Kutumbakam – The [Ap]
World is One Family!” with a heading, paragraph, and image. Style the web
a. Set a suitable background image for the entire web page. The image
should not be
d. Change the font size of all paragraphs to 14 pixels and colour to blue-
green.
Pg no. 4
5. Using CSS in HTML
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Pg no. 5