Menu
CoddyTech

Choosing Utilities

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

A museum label with block starts a block box. A second label with inline participates in the surrounding line of text. These utilities change layout without changing the meaning of the HTML element.

<div class="block">Museum sample</div>

Use hidden to remove a box from layout, or inline-block for a box that sits in a line but can have dimensions. Choose utilities for the required behavior rather than replacing semantic HTML with an unrelated tag. Numeric spacing uses a 0.25rem unit, normally 4 pixels: multiply the utility number by 4 to find the pixel spacing. The flex display mode creates a flex container and places direct children in a row by default.

challenge icon

Challenge

Easy

Make the supplied Workshop container a flex container. Flex places its direct children in a row by default; do not change their text.

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=""><span>Sketch</span><span>Build</span></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