NEW
Font size
S
M
L
XL
WorksheetsCSS - Quiz 2
Total questions: 40
Worksheet time: 20mins
Name
Class
Date
1.
Which property is used to change the background color?
a)
color
b)
background-color
c)
bgcolor
d)
background-style
2.
Which HTML tag is used to define an internal style sheet?
a)
<css>
b)
<script>
c)
<style>
d)
<link>
3.
What is the correct CSS syntax for making all <p> elements bold?
a)
p {font-weight: bold;}
b)
p {text-size: bold;}
c)
p {font-style: bold;}
d)
p {style: bold;}
4.
How do you select an element with the id "header"?
a)
.header
b)
header
c)
*header
d)
#header
5.
Which property is used to change the left margin of an element?
a)
margin-left
b)
padding-left
c)
indent-left
d)
spacing-left
6.
How do you select elements with the class name "menu"?
a)
menu
b)
.menu
c)
#menu
d)
(menu)
7.
What is the default value of the position property?
a)
relative
b)
absolute
c)
static
d)
fixed
8.
Which property is used to change the font of an element?
a)
font-style
b)
font-family
c)
font-type
d)
font-weight
9.
Which CSS property controls the text size?
a)
text-style
b)
text-size
c)
font-height
d)
font-size
10.
How do you make a list with square bullets?
a)
list-style-type: square;
b)
list-type: square;
c)
type: square;
d)
list-style: square;
11.
Which property is used to center text?
a)
align-text
b)
center-text
c)
text-align
d)
middle-align
12.
How do you display hyperlinks without an underline?
a)
a {underline: none;}
b)
a {text-decoration: none;}
c)
a {text-style: none;}
d)
a {decoration: none;}
13.
Which property creates space between the border and the inner content?
a)
margin
b)
spacing
c)
border-spacing
d)
padding
14.
How do you make text italic?
a)
font-style: italic;
b)
font-weight: italic;
c)
text-style: italic;
d)
font-italic: true;
15.
Which property is used to change the thickness of a border?
a)
border-size
b)
border-width
c)
border-weight
d)
border-thickness
16.
What does the "a" in RGBA stand for?
a)
Array
b)
Alignment
c)
Alpha
d)
Alternative
17.
How do you select all <p> elements inside a <div>?
a)
div p
b)
div + p
c)
div.p
d)
div > p
18.
Which property sets the image for a background?
a)
background-src
b)
background-image
c)
bg-image
d)
image-background
19.
How do you group multiple selectors to apply the same style?
a)
Separate with a plus
b)
Separate with a space
c)
Separate with a dot
d)
Separate with a comma
20.
Which property is used to change the stack order of an element?
a)
z-index
b)
stack-order
c)
layer-index
d)
order
21.
What is the correct way to write a comment in CSS?
a)
// comment
b)
/* comment */
c)
# comment
22.
Which value of position keeps an element fixed during scrolling?
a)
absolute
b)
relative
c)
sticky
d)
fixed
23.
Which property is used to make a grid container?
a)
display: grid;
b)
grid: true;
c)
layout: grid;
d)
box-type: grid;
24.
How do you make the text uppercase?
a)
text-style: uppercase;
b)
text-transform: uppercase;
c)
font-case: uppercase;
d)
case: uppercase;
25.
Which property sets the spacing between lines of text?
a)
text-spacing
b)
font-spacing
c)
line-height
d)
leading
26.
What is the correct CSS to make a border rounded?
a)
border-radius
b)
border-round
c)
corner-radius
d)
border-curve
27.
Which property is used to change the mouse cursor?
a)
mouse-pointer
b)
cursor
c)
pointer-type
d)
cursor-style
28.
Which property defines the order of flex items?
a)
priority
b)
flex-order
c)
item-index
d)
order
29.
How do you select the first child <p> of its parent?
a)
p:first-child
b)
p:first
c)
p:child(1)
d)
p.first
30.
Which property sets the width of an element?
a)
size
b)
width
c)
box-width
d)
horizontal-size
31.
What is the purpose of the !important rule?
a)
Makes the text bold
b)
Links a stylesheet
c)
Overrides all other rules
d)
Highlights code
32.
Which property hides an element while keeping its space?
a)
visibility: hidden;
b)
display: none;
c)
opacity: 0;
d)
hidden: true;
33.
Which unit is relative to the element's font-size?
a)
px
b)
cm
c)
pt
d)
em
34.
Which property sets the shadow of a box?
a)
box-shadow
b)
shadow-effect
c)
element-shadow
d)
border-shadow
35.
How do you align flex items vertically?
a)
justify-content
b)
align-items
c)
vertical-align
d)
flex-align
36.
What does float: right; do?
a)
Aligns text to right
b)
Makes element invisible
c)
Pushes element to right
d)
Moves element to top
37.
Which property changes the space between characters?
a)
letter-spacing
b)
word-spacing
c)
character-spacing
d)
text-indent
38.
How do you select all elements?
a)
&
b)
*
c)
all
d)
.all
39.
Which property is used to change the background image size?
a)
background-size
b)
img-size
c)
bg-dimension
d)
background-scale
40.
Which property defines how to wrap text?
a)
word-wrap
b)
text-wrap
c)
overflow-wrap
d)
wrap-style
Reset
