Recall & Review
beginner
What does the Tailwind CSS class
hidden do?The <code>hidden</code> class completely hides an element by setting <code>display: none;</code>. The element is removed from the page layout and is not visible or accessible.Click to reveal answer
beginner
How does the Tailwind class
invisible differ from hidden?The <code>invisible</code> class makes an element invisible but it still takes up space in the layout. It sets <code>visibility: hidden;</code>, so the element is hidden but the space it occupies remains.Click to reveal answer
intermediate
Which Tailwind class would you use to hide an element only on small screens but show it on medium and larger screens?You can use
hidden sm:block. This hides the element on small screens (<640px) and shows it as a block on screens medium and larger (≥640px).Click to reveal answer
intermediate
What is the effect of using
opacity-0 in Tailwind CSS?The <code>opacity-0</code> class makes the element fully transparent but it remains visible to screen readers and still occupies space. It sets <code>opacity: 0;</code>.Click to reveal answer
advanced
Why is it important to use semantic visibility classes like
hidden or invisible instead of just setting display: none; in CSS directly?Using Tailwind classes keeps your code consistent and easier to maintain. It also helps with responsive design by combining visibility control with breakpoints. Plus, Tailwind classes are optimized and easy to read.
Click to reveal answer
What does the Tailwind class
hidden do?✗ Incorrect
hidden sets display: none;, removing the element from layout and hiding it.Which class hides an element but keeps its space reserved?
✗ Incorrect
invisible sets visibility: hidden;, hiding the element but keeping its space.How do you hide an element on small screens but show it on medium and larger screens in Tailwind?
✗ Incorrect
hidden sm:block hides on small screens and shows on medium (sm) and larger.What does
opacity-0 do in Tailwind CSS?✗ Incorrect
opacity-0 sets opacity to zero, making the element transparent but still occupying space.Why use Tailwind's visibility classes instead of custom CSS?
✗ Incorrect
Tailwind classes make code consistent, easier to maintain, and support responsive visibility control.
Explain the difference between the Tailwind classes
hidden and invisible.Think about whether the element still takes up space on the page.
You got /4 concepts.
How can you use Tailwind classes to control element visibility responsively?
Consider how Tailwind handles responsive design with prefixes.
You got /4 concepts.