Recall & Review
beginner
What does the CSS property
z-index control?The
z-index property controls the vertical stacking order of elements that overlap. Higher values appear on top of lower values.Click to reveal answer
beginner
How do you apply a
z-index value of 10 using Tailwind CSS?Use the class
z-10 to set z-index: 10; in Tailwind CSS.Click to reveal answer
intermediate
What must be true about an element for
z-index to work?The element must have a position other than
static (like relative, absolute, fixed, or sticky) for z-index to take effect.Click to reveal answer
beginner
What Tailwind class sets an element's position to <code>relative</code>?The class
relative sets position: relative; in Tailwind CSS.Click to reveal answer
intermediate
If two elements have the same
z-index, which one appears on top?The element that appears later in the HTML code (lower in the source order) will appear on top if
z-index values are equal.Click to reveal answer
Which Tailwind class sets
z-index: 20;?✗ Incorrect
The class
z-20 sets z-index: 20; in Tailwind CSS.What is required for
z-index to work on an element?✗ Incorrect
z-index only works if the element's position is relative, absolute, fixed, or sticky, not static.If two elements overlap and both have
z-index: 10;, which one is on top?✗ Incorrect
When
z-index values are equal, the element later in the HTML source appears on top.Which Tailwind class sets
position: relative;?✗ Incorrect
The Tailwind class
relative sets position: relative;.What does a higher
z-index value mean?✗ Incorrect
Higher
z-index values make elements appear on top of those with lower values.Explain how
z-index controls stacking order and what conditions must be met for it to work.Think about how layers stack in real life, like papers on a desk.
You got /3 concepts.
Describe how to use Tailwind CSS classes to control stacking order and positioning of elements.
Remember Tailwind uses short class names for common CSS properties.
You got /3 concepts.