Revison bank comp. CSS .html
Revison bank comp. CSS .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;}
vi. Which HTML5 semantic tag is used to display content that is related, but
secondary to the main content, like a sidebar?
vii. Which CSS rule would you use to make a paragraph’s text bold and change its
size to 24 pixels?
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
element in an HTML file?
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
iv. What is the advantage of using an external style sheet over internal style
sheet.
Ans. An external style sheet is ideal for applying the same styles
It saves time because you can define styles once in a separate CSS
file and link it to many HTML files. This makes it easier to update
the style of a whole website by modifying just one CSS file, instead
Pg no. 3
5.Using CSS in HTML
v. 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
vi. 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. 4
5.Using CSS in HTML
</body></html>
vii. Write a CSS rule to style a table with the following properties:
1. Set the outer border of the table to be 3 pixels.
2. Ensure the borders of the table cells are separated.
3. Add 15 pixels of padding inside each table cell.
Ans. table {
border-width: 3px;
border-collapse: separated;
}
th, td {
padding: 15px;
}
Pg no. 5
5.Using CSS in HTML
viii. Write the CSS code used to display the image ‘flower.jpg’ in the
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;
}
Pg no. 6