Test your knowledge of essential CSS concepts including positioning, stacking context, specificity, units, pseudo-classes, variables, transitions, and media queries. This quiz is perfect for web developers looking to strengthen their understanding of modern CSS techniques.
Question 1
What does the :hover
pseudo-class do?
Selects the first child
Applies styles when an element is clicked
Applies styles when the mouse is over the element
Selects the last child
Question 3
In CSS specificity, which selector has the highest specificity?
element selector
class selector
ID selector
universal selector
Question 4
Which of the following does NOT create a new stacking context?
opacity: 0.9
position: relative with z-index: 10
position: static
position: fixed
Question 5
What is a stacking context in CSS?
A group of elements with the same color
A conceptual three-dimensional space for stacking elements
A CSS selector
A type of media query
Question 6
Which property controls the stack order of positioned elements?
order
z-index
layer
float
Question 7
An element with position: absolute;
is positioned relative to:
the viewport
its nearest positioned ancestor
the body
the next sibling
Question 8
Which positioning method will keep an element in the same place even when the page is scrolled?
absolute
sticky
fixed
relative
Question 9
What is the default value of the CSS position
property?
relative
static
absolute
fixed
Question 10
Which CSS property is used to specify the type of positioning method for an element?
float
display
position
align
There are 15 questions to complete.