YouTip LogoYouTip

Tailwindcss Typography

Tailwind CSS's **Typography** feature is a set of utility classes that helps developers efficiently design text styles. It includes basic typography properties such as setting fonts, font weights, line heights, letter spacing, text alignment, and also supports complex typography needs like responsive font sizes, text shadows, text decorations, etc. ### 1. **Font Family** Tailwind provides some utility classes to set font families (font-family), which can be easily applied through class names. #### Common Utility Classes: * `font-sans`: Sets sans-serif font. * `font-serif`: Sets serif font. * `font-mono`: Sets monospace font. ## Example

Test Text Content ...

Test Text Content ...

Test Text Content ...

[Try it Β»](#) ### 2. **Font Size** Font size can be controlled through Tailwind's `text-*` utility classes, supporting various sizes from `text-xs` to `text-9xl`, and you can even customize font sizes. #### Common Utility Classes: * `text-xs`, `text-sm`, `text-base`, `text-lg`, `text-xl`, `text-2xl`, ..., `text-9xl` ## Example

Test Text Content ...

Test Text Content ...

Test Text Content ...

Test Text Content ...

Test Text Content ...

[Try it Β»](#) ### 3. **Font Weight** Font weight can be controlled through `font-*` utility classes. Tailwind provides various weight options from `font-thin` to `font-black`. #### Common Utility Classes: * `font-thin`: Ultra thin font * `font-light`: Light font * `font-normal`: Normal font * `font-medium`: Medium weight font * `font-semibold`: Semi bold font * `font-bold`: Bold font * `font-extrabold`: Extra bold font * `font-black`: Black font ## Example

Test Text Content ...

Test Text Content ...

Test Text Content ...

Test Text Content ...

Test Text Content ...

[Try it Β»](#) ### 4. **Line Height** Line height (line spacing) can be controlled through `leading-*` utility classes. Tailwind provides various line height options from `leading-none` to `leading-loose`, which can be adjusted as needed. #### Common Utility Classes: * `leading-none`: Line height of 1 * `leading-tight`: Tight line height * `leading-snug`: Slightly tight line height * `leading-normal`: Default line height * `leading-relaxed`: Relaxed line height * `leading-loose`: Loose line height ## Example

So I started to walk into the water...

So I started to walk into the water...

So I started to walk into the water...

[Try it Β»](#) ### 5. **Letter Spacing** Letter spacing can be controlled through `tracking-*` utility classes. Common letter spacing options include `tracking-tight`, `tracking-normal`, and `tracking-wide`, which are used to adjust the space between letters. #### Common Utility Classes: * `tracking-tight`: Tight letter spacing * `tracking-normal`: Default letter spacing * `tracking-wide`: Wide letter spacing * `tracking-wider`: Wider letter spacing * `tracking-wide`: Widest letter spacing ## Example

Test Text Content ...

Test Text Content ...

Test Text Content ...

[Try it Β»](#) ### 6. **Text Color** Tailwind provides various text color classes, allowing you to set different colors for text. You can use `text-*` utility classes to set colors. #### Common Utility Classes: * `text-gray-500`: Medium gray * `text-red-500`: Red * `text-blue-500`: Blue * `text-green-500`: Green ## Example

Test Text Content...

Test Text Content...

Test Text Content...

Test Text Content...

Test Text Content...

[Try it Β»](#) ### 7. **Text Alignment** Tailwind provides simple utility classes to control text alignment. You can use `text-left`, `text-center`, or `text-right` to set text alignment. #### Common Utility Classes:
← Tailwindcss BordersTailwindcss Sizing β†’