Responsive Visibility
Part of the Fundamentals section of Coddy's Tailwind CSS journey. Lesson 39 of 55.
A supplementary label with hidden md:block takes no layout space below md and becomes a block at md and wider. Essential information should remain available at every width, even if decorative detail is hidden.
<div class="hidden md:block">Museum sample</div>Use display utilities for a genuine visibility change, not to imitate smaller fonts or narrower margins. If an element contains keyboard controls, hiding it also removes those controls from normal keyboard navigation.
Challenge
MediumHide the optional museum hours badge below 1024 pixels and show it as an inline block from 1024 pixels upward.
Keep the supplied content and element IDs. Edit the HTML utility classes or the requested CSS. Click Run preview to refresh the preview after edits, then use Check/Run code to grade your work.
Try it yourself
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Practice studio</title><link rel="stylesheet" href="./styles.css"></head><body>
<div id="target" class="">Extended hours</div>
</body></html>
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Fundamentals
1Meet Tailwind
A Styled First RunChoosing UtilitiesCombining UtilitiesThe Local StylesheetRecap: Meet Tailwind8Responsive Design
Breakpoint PrefixesResponsive DirectionResponsive GridResponsive VisibilityRecap: Responsive Design