font-serif: Tailwind CSS Font Family class

The font-serif class applies a serif font, commonly used for a classic and elegant look.


Interactive Font Weight Playground

Try each class live and inspect the CSS output.

Use weight to establish clear visual hierarchy in your UI text.

Utility class
font-semibold
CSS output
font-weight: 600;

Font-Serif

The font-serif class applies a serif font, commonly used for a classic and elegant look.

Example Code

HTML
1<div
2 class="p-5 font-bold bg-gray-100 rounded-t-md flex flex-col justify-center items-center"
3>
4 <h3 class="text-gray-500 mr-48">Font-Serif</h3>
5 <p class="font-serif ml-10">How vexingly quick daft zebras jump.</p>
6</div>

Preview

Font-Serif

How vexingly quick daft zebras jump.

How to Use

Add the font-serif class directly to your HTML element:

HTML
1<div class="font-serif">
2 <!-- Your content here -->
3</div>

Responsive Usage

Use Tailwind's responsive prefixes to apply font-serif at specific breakpoints:

HTML
1<div class="sm:font-serif md:font-serif lg:font-serif">
2 Responsive element
3</div>
  • sm:font-serif — applies from 640px and up
  • md:font-serif — applies from 768px and up
  • lg:font-serif — applies from 1024px and up

Customization

You can extend or override this utility in your tailwind.config.js. See the Tailwind CSS documentation for details on customizing your theme.

Windframe is an AI visual editor for rapidly building stunning web UIs & websites

Start building stunning web UIs & websites!

Build from scratch or select prebuilt tailwind templates