Font Sizes
Part of the Fundamentals section of Coddy's Tailwind CSS journey. Lesson 11 of 55.
A caption with text-sm renders at 14 pixels under the default root size. A nearby heading with text-2xl renders at 24 pixels. Named text sizes come from the theme rather than the spacing scale.
<div class="text-sm">Museum sample</div>Size utilities also provide a matching default line height. Keep real heading elements for document structure; a large paragraph is not a heading merely because it looks large. Useful default sizes are text-xs (12px), text-sm (14px), text-base (16px), text-lg (18px), text-xl (20px), text-2xl (24px), text-3xl (30px) and text-4xl (36px).
Challenge
EasySet the workshop heading to a 20-pixel font size without changing its heading tag.
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>
<h2 id="target" class="">Watercolor Workshop</h2>
</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 Tailwind