NEW
Font size
WorksheetsQ4 Exam 1 (8.10, 8.11, 8.12)
Total questions: 20
Worksheet time: 15mins
What does CSS stand for?
Creative Style Sheets
Cascading Style Sheets
Computerized Style Structure
Colorful Site Styles
Which of the following is the correct way to apply an external CSS file to an HTML document?
<css> styles.css</css>
<link rel= "stylesheet" href="styles.css">
<style>styles.css<style>
<script src="styles.css"></script>
How do you select all <h1> elements in a CSS file?
#h1 { color: blue; }
.h1 { color: blue; }
h1 { color: blue; }
<h1> { color: blue; }
What is the correct way to apply a CSS rule to an HTML class named "highlight" ?
#highlight { color: yellow; }
.highlight { color: yellow; }
<highlight> { color: yellow; }
highlight { color: yellow; }
Which CSS property is used to change the background color of an element?
color
text-color
background-color
bgcolor
What is the default position of an HTML element?
relative
absolute
static
fixed
What symbol is used to select an ID in CSS?
. (dot)
# (hashtag)
* (asterisk)
@ (at symbol)
Which of the following CSS rules correctly applies a font size of 16px to all <p> elements?
p { font-size: 16px; }
.p { font-size: 16px; }
<p> { font-size: 16px; }
#p { font-size: 16px; }
What is the difference between an ID selector and a class selector?
IDs can be used for multiple elements, while classes apply to only one element.
IDs are used only in JavaScript, while classes are used in CSS.
Classes can be used for multiple elements, while IDs should be unique.
There is no difference; they are interchangeable.
Which of the following is the correct way to apply multiple CSS classes to a single HTML element?
<p class="class1, class2">
<p class="class1 class2">
<p class="class1; class2">
<p class="class1.class2">
What does the text-align property do?
Changes the font of the text
Moves the text to the left, center, or right
Changes the size of the text
Makes the text bold
The space inside an element’s border is controlled by which CSS property?
padding
margin
border-width
spacing
Which CSS rule will apply a blue text color to elements with the class "title"?
#title { color: blue; }
title { color: blue; }
.title { color: blue; }
<title> { color: blue; }
How do you write a CSS comment?
// This is a comment
/* This is a comment */
<!-- This is a comment -->
" This is a comment "
Which of the following correctly sets the background color of all <div> elements to red?
.div { background-color: red; }
<div> { background-color: red; }
#div { background-color: red; }
div { background-color: red; }
Which of the following statements is true about CSS classes?
You can use the same class name on multiple elements.
A class name must always start with a number.
Class names must be written in all uppercase letters.
A class name can only be used once per HTML document.
How do you apply an ID selector named "main-heading" to an <h1> element in CSS?
h1.main-heading {}
h1#main-heading {}
#main-heading {}
id=main-heading {}
What is the correct way to change the font style of a <p> tag to italic?
p { text-style: italic; }
p { font-style: italic; }
p { style: italic; }
p { italic: true; }
Which CSS property controls the space outside an element’s border?
padding
margin
border-spacing
outline
What will the following CSS rule do?
.button {
background-color: blue;
color: #222;
}
It makes the background color of all buttons blue with white text.
It makes the background color of any element with the class "button" blue with white text.
It makes only <button> elements blue with white text.
It will not apply to any elements because "button" is a reserved keyword.
