NEW
Font size
Worksheets[Week 4 ] CSS Essentials: Box Model, Layouts, and Styling
Total questions: 25
Worksheet time: 38mins
What are the four components of the CSS Box Model?
Content, Padding, Margin, Border
Content, Margin, Border, Width
Padding, Border, Height, Width
Content, Padding, Height, Margin
What does the Padding property do in the Box Model?
Adds space outside the border
Adds space between the content and the border
Changes the border color
Resizes the element
Which property is used to define the space outside the element?
Padding
Margin
Border
Width
What does the box-sizing property do when set to border-box?
It includes padding and border in the element’s total width and height
It excludes padding and border from the element’s total width and height
It only affects the border
It changes the display property
Which of the following lengths is relative to the viewport width?
px
em
vw
rem
Which property is commonly used to center an element horizontally?
text-align: center;
margin: auto;
display: block;
float: left;
How do you adjust the spacing between elements in CSS?
By changing the line-height
By using padding and margin
By altering the font size
By using text-indent
What does inheritance in CSS refer to?
Elements receiving styles from their parent elements
Copying styles from one element to another
Using the same class for multiple elements
Styling elements based on their type
Which color model uses RGB values?
HSL
CMYK
HEX
RGB
What is the purpose of the Developer Tools in browsers?
To edit images
To debug and analyze web pages
To create HTML documents
To optimize server performance
Which CSS property is used to change the font size?
font-style
font-weight
font-size
text-size
Which of the following is NOT a valid CSS length unit?
px
em
km
rem
What does the property 'color' change in CSS?
Background color
Text color
Border color
Padding color
Which CSS property controls the space between lines of text?
letter-spacing
word-spacing
line-height
text-indent
How can you make text bold in CSS?
font-style: bold;
font-weight: bold;
text-decoration: bold;
font-size: bold;
Which of the following selectors will select all
elements?
.h1
#h1
h1
h1{}
Which of the following properties can be used to change the background color of an element?
color
background-color
bg-color
background
What does the 'float' property do in CSS?
Aligns an element to the left or right of its container
Centers an element
Changes the display type of an element
Adjusts the margin of an element
Which CSS function allows for color manipulation?
rgb()
color()
hue()
rgba()
Which CSS property is used to create space between the content and the border of an element?
margin
padding
border-spacing
gap
What is the default value of the 'inherit' property in CSS?
It inherits the value from its parent
It resets to the browser default
It has no effect
It applies a global style
Which CSS property is NOT inherited by default?
color
font-size
margin
line-height
How can you explicitly prevent an element from inheriting a style?
By using the 'initial' value
By using the 'unset' value
By using the 'inherit' value
By using the 'none' value
What is the unit 'vh' in CSS used for?
Viewport height
Viewport width
Vertical height
Vertical width
Which of the following units is best for responsive typography?
px
em
pt
cm
