Chapter test-WPS Office
Chapter test-WPS Office
a) font-style
b) color
c) text-decoration
d) text-align
Which of the following selectors would select all paragraph elements inside a <div> with a class of
"container"?
a) div p.container
b) .container p
c) p.container
d) div.container p
b) <style src="style.css">
d) <stylesheet href="style.css">
Which of the following properties is used to control the space between elements?
a) padding
b) border
c) margin
d) spacing
a) .header
b) #header
c) header
d) *header
a) color
b) background-color
c) bgcolor
d) background-style
b) font-style
c) font-weight
d) text-transform
What value of the position property will keep an element in the same place even when the page is
scrolled?
a) static
b) relative
c) fixed
d) absolute
a) em
b) px
c) %
d) rem
In the shorthand margin: 10px 15px;, what does each value represent?
How do you apply a font family that includes spaces (e.g., "Times New Roman")?
a) font-family: Times New Roman;
What is the default value of the position property for most HTML elements?
a) relative
b) fixed
c) absolute
d) static
Which CSS property would you use to make an element's text all uppercase?
a) text-transform
b) text-decoration
c) font-variant
d) font-style
a) // This is a comment
b) /* This is a comment */
d) # This is a comment
Which value for the display property hides an element but leaves space for it on the page?
a) none
b) hidden
c) inline
d) visibility
What is the correct CSS syntax to make all elements with a class of "menu" hidden?
Which CSS property would you use to control the size of a flex container's children?
a) display
b) flex-grow
c) overflow
d) align-items
How do you select all <a> elements within a <div> with the class "navbar"?
a) div a.navbar
c) .navbar a
d) .navbar > a
a) To import an image
These questions cover a range of CSS concepts, including basic properties, layout techniques, selectors,
and CSS syntax rules. Let me know if you'd like more specific topics or types of questions!
You said:
Answers key
ChatGPT said:
ChatGPT
Here's the answer key for the additional multiple-choice CSS questions:
b) background-color
The padding property adds space inside the border, around the content.
c) font-weight
c) fixed
position: fixed; keeps an element in place even when scrolling.
b) px
margin: 10px 15px; sets the top and bottom margins to 10px, and the left and right margins to 15px.
Both double and single quotes can be used around font-family names with spaces.
d) static
a) text-transform
b) / This is a comment /
d) visibility
b) flex-grow
c) .navbar a
@import is used to import another CSS file into the current one.
These answers correspond to CSS syntax, rules, and behavior for various properties and concepts. Let
me know if you need further clarification on any of the answers!