WorksheetsCSS Basics Quiz
Total questions: 15
Worksheet time: 8mins
What is the main purpose of a Style Sheet (CSS)?
To add images to a web page
To design the appearance (look & feel) of a web page
To store website data
To create links between pages
Which statement best describes the relationship between HTML and CSS?
HTML adds style; CSS adds structure
CSS replaces HTML
HTML creates structure; CSS makes it look attractive
Both HTML and CSS perform the same task
Which method of applying CSS is considered the best practice for large websites?
Inline CSS
Internal CSS
External CSS
Comment CSS
What is the correct syntax for a CSS rule?
selector: { value = property }
selector { property: value; }
{ selector value: property }
(selector property: value)
Which of the following is an example of an inline CSS style?
<style> h1 { color: blue; } </style>
<h1 style="color: blue;">My School</h1>
h1 { color: blue; } (inside style.css)
<link rel="stylesheet" href="style.css">
How do you write a single-line CSS comment?
// This is a comment
<!-- This is a comment -->
/* This is a comment */
# This is a comment
Which selector is used to apply style to a single unique element?
Class selector
Element selector
Group selector
ID selector
What symbol is used to select a class in CSS?
#
.
*
:
Which CSS selector will style ALL
tags in a web page?
#p { }
.p { }
p { }
*p { }
Which of the following correctly groups multiple selectors?
h1 + h2 + h3 { color: red; }
h1 h2 h3 { color: red; }
h1, h2, h3 { color: red; }
h1:h2:h3 { color: red; }
Which method places CSS inside the <head> section of an HTML file?
Inline CSS
External CSS
Internal CSS
Outline CSS
Which of the following is the correct way to connect an external CSS file?
<css src="style.css">
<style href="style.css">
<link rel="stylesheet" href="style.css">
<script src="style.css">
Which selector is used to select multiple elements to apply the same style?
Group selector
ID selector
Universal selector
Attribute selector
What will the following CSS rule do?
h2 {
color: green;
}
Changes the background of all <h2> elements
Changes the text color of all <h2> elements
Changes only the first <h2> element
Creates a new <h2> element
What is the purpose of writing comments in CSS?
To hide CSS from the browser
To explain code and improve readability
To make the page load faster
To create new selectors
