Home
Daily
TailwindCSS 3: Typography & Colors - Make Your UI Look Clean & Modern
December 03, 2025
1 min

Table Of Contents

01
🎯 What You Will Learn
02
🔡 Text Size (text-*)
03
🏋️ Font Weight (font-*)
04
🎨 Text Colors (text-*)
05
🎨 Background Colors (bg-*)
06
🖱️ Hover States (hover:*)
07
🎁 Mini Demo: Create a Clean Hero Section
08
✅ Summary

Now in this lesson, we will learn how to style text and colors — the things users notice first when viewing a UI.


🎯 What You Will Learn

By the end of this lesson, you’ll understand:

TopicWhat it means
Text sizeHow to make text bigger or smaller
Font weightControl emphasis (bold / light / normal)
Text colorApply color from Tailwind’s built-in palette
Background colorColor elements like buttons and sections
Hover color statesChange color when the user hovers

Let’s go step-by-step.


🔡 Text Size (text-*)

Tailwind provides a wide range of text sizes:

<p class="text-sm">Small text</p>
<p class="text-base">Default text</p>
<p class="text-lg">Large text</p>
<p class="text-3xl">Very large text</p>

Common sizes you’ll use most:

ClassSize
text-smsmall text
text-basenormal body text
text-xlsection titles
text-3xlheadings / hero titles

🏋️ Font Weight (font-*)

Use font weight to emphasize text:

<p class="font-light">Thin text</p>
<p class="font-normal">Regular text</p>
<p class="font-bold">Bold text</p>
<p class="font-extrabold">Extra bold text</p>

🎨 Text Colors (text-*)

Tailwind provides a large color palette. Here are examples with gray and blue:

<p class="text-gray-700">Neutral text</p>
<p class="text-blue-500">Colored text</p>

Common useful colors:

  • text-gray-600 (soft, readable)
  • text-gray-800 (strong, high contrast)
  • text-blue-500 (primary action)

🎨 Background Colors (bg-*)

Apply background colors easily:

<div class="bg-gray-100 p-4">Light gray background</div>
<button class="bg-blue-500 text-white px-4 py-2 rounded">Primary button</button>

🖱️ Hover States (hover:*)

To add hover effects, just prefix with hover::

<button class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded">
Hover Me
</button>

Hover state should usually be slightly darker or lighter.


🎁 Mini Demo: Create a Clean Hero Section

Here’s a simple hero block you can copy and use:

<section class="p-8 text-center">
<h1 class="text-4xl font-bold text-gray-900 mb-4">
Welcome to TailwindCSS
</h1>
<p class="text-gray-600 mb-6">
Build modern websites faster, easier, and without writing custom CSS.
</p>
<button class="bg-blue-500 hover:bg-blue-600 text-white px-6 py-3 rounded">
Get Started
</button>
</section>

What you see here:

  • text-4xl font-bold → Large bold headline
  • text-gray-600 → Soft body text
  • bg-blue-500 hover:bg-blue-600 → Beautiful button with hover effect

Clean, simple, minimal design ✨


✅ Summary

FeatureExamplePurpose
Text sizetext-lg, text-4xlControl typography scale
Font weightfont-boldEmphasize text
Text colortext-gray-700Make text readable
Background colorbg-blue-500Highlight elements
Hover stateshover:bg-blue-600UI feels alive and interactive

Typography + Color = Professional looking UI



Tags

#tailwindcss

Share

Related Posts

Tailwind CSS
TailwindCSS 9: Using `tailwind.config.js` to Create Your Own Design System
December 09, 2025
1 min
© 2025, All Rights Reserved.
Powered By

Social Media

githublinkedinyoutube