Menu
CoddyTech

Element Height

Part of the Fundamentals section of Coddy's Tailwind CSS journey. Lesson 32 of 55.

A thumbnail placeholder with h-40 is 160 pixels high. Numeric height utilities use the spacing unit, while h-auto lets content and layout determine height.

<div class="bg-black text-white h-40">Museum sample</div>

Fixed height is useful for a measured preview but can clip growing text if overflow is hidden. For a panel that must grow, prefer a minimum height instead of forcing all content into a short fixed box.

challenge icon

Challenge

Medium

Set the exhibition preview area to a height of 288 pixels.

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="bg-black text-white">Preview area</div>
</body></html>
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Fundamentals