Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What is a display mode in CSS?
A display mode controls how an element is shown on the page, like whether it takes up space as a block, flows inline with text, or is hidden.
Click to reveal answer
beginner
Why is choosing the right display mode important?
It helps arrange content clearly, making the page easy to read and interact with on different devices.
Click to reveal answer
beginner
How does Tailwind CSS help with display modes?
Tailwind provides simple classes like block, inline, and hidden to quickly change how elements display without writing custom CSS.
Click to reveal answer
beginner
What happens if you use hidden in Tailwind?
The element is not shown on the page and does not take up any space.
Click to reveal answer
intermediate
How can display modes affect responsive design?
You can show or hide elements on different screen sizes using display classes, making your site look good on phones and desktops.
Click to reveal answer
Which Tailwind class makes an element take up the full width and start on a new line?
Ablock
Binline
Chidden
Dflex
✗ Incorrect
The block class makes an element behave like a block, taking full width and starting on a new line.
What does the Tailwind class inline do?
AHides the element
BDisplays element in a line with text
CMakes element a flex container
DMakes element a grid container
✗ Incorrect
inline makes the element flow with text on the same line.
If you want to hide an element on small screens and larger, which Tailwind class would you use?
Asm:hidden
Bhidden
Cblock
Dmd:hidden
✗ Incorrect
sm:hidden hides the element from the sm breakpoint (640px) and larger.
Why should you avoid using display:none for important content?
AIt adds extra space
BIt changes the font size
CIt makes content bold
DIt makes content invisible and inaccessible to screen readers
✗ Incorrect
display:none hides content visually and from screen readers, which can hurt accessibility.
Which display mode is best for creating a navigation bar with items side by side?
Ablock
Binline
Cflex
Dhidden
✗ Incorrect
flex allows easy horizontal layout of navigation items.
Explain why display modes matter when building a website with Tailwind CSS.
Think about how elements appear and behave on different devices.
You got /4 concepts.
Describe how you would use Tailwind display classes to show a menu only on large screens.
Consider hiding first, then showing at a breakpoint.
You got /3 concepts.
Practice
(1/5)
1. Which Tailwind class makes an element behave like a block-level element, taking full width by default?
easy
A. block
B. inline
C. inline-flex
D. hidden
Solution
Step 1: Understand block display behavior
A block element takes the full width available and starts on a new line.
Step 2: Match Tailwind class to behavior
The block class in Tailwind applies this block display mode.
Final Answer:
<code>block</code> -> Option A
Quick Check:
Block display = block class [OK]
Hint: Block elements use block class for full width [OK]
Common Mistakes:
Confusing inline with block display
Thinking flex is block by default
Assuming hidden shows the element
2. Which Tailwind class correctly hides an element from the page?
easy
A. hidden
B. block
C. visible
D. flex
Solution
Step 1: Identify the class that hides elements
The hidden class in Tailwind sets display: none;, hiding the element.
Step 2: Confirm other classes show elements
visible is not a Tailwind display class, block and flex show elements.
Final Answer:
<code>hidden</code> -> Option A
Quick Check:
Hide element = hidden class [OK]
Hint: Use hidden to hide elements in Tailwind [OK]
Common Mistakes:
Using visible which is not a Tailwind display class
Confusing block or flex as hiding classes
Trying to hide with opacity or visibility classes only
3. What will be the layout behavior of this element with Tailwind classes: inline flex?
medium
A. The element behaves as a block and its children are flex items.
B. The element behaves as a flex container and takes full width.
C. The element is hidden because conflicting display classes cancel out.
D. The element behaves inline but also applies flex layout to its children.
Solution
Step 1: Understand Tailwind display class precedence
Tailwind applies the last display class in the list, so flex overrides inline.
Step 2: Check combined classes effect
However, if both are applied, the element behaves as a flex container, but if inline is applied first and flex second, it becomes a flex container with block behavior.
Step 3: Clarify the question's class order
Since classes are inline flex, flex overrides inline, so element behaves as flex container (block-level).
Final Answer:
The element behaves as a flex container and takes full width. -> Option B
Quick Check:
Last display class wins = flex container [OK]
Hint: Last display class in Tailwind wins [OK]
Common Mistakes:
Thinking multiple display classes combine effects
Assuming inline and flex can coexist
Ignoring class order importance
4. You want a container to arrange children horizontally using Tailwind, but your code uses block and children stack vertically. What is the mistake?
medium
A. Using flex on children instead of container
B. Not adding inline to children
C. Forgetting to add hidden to children
D. Using block instead of flex on the container
Solution
Step 1: Understand display modes for layout
block makes container stack children vertically by default.
Step 2: Use flex for horizontal layout
To arrange children horizontally, container must have flex display.
Final Answer:
Using block instead of flex on the container -> Option D
Quick Check:
Horizontal layout needs flex container [OK]
Hint: Use flex on container for horizontal layout [OK]
Common Mistakes:
Applying flex to children instead of container
Thinking inline arranges children horizontally
Not understanding block stacks vertically
5. You want a button to be inline with text but also have flex layout inside to center icon and label. Which Tailwind classes correctly achieve this?
hard
A. inline-block flex justify-between
B. block flex justify-center
C. inline-flex items-center
D. flex inline items-start
Solution
Step 1: Make button inline with text
The inline-flex class makes the button flow inline with text.
Step 2: Apply flex layout inside button
The inline-flex class makes the button a flex container for its children.
Step 3: Center icon and label vertically
items-center aligns children vertically center inside flex container.
Final Answer:
<code>inline-flex items-center</code> -> Option C
Quick Check:
Inline + flex + center items = inline-flex items-center [OK]
Hint: Use inline-flex items-center for inline flex centering [OK]
Common Mistakes:
Using block makes button block-level, breaking inline flow
Wrong order or missing items-center for vertical alignment