Installation

Get started with Tailwind CSS

Tailwind CSS works by scanning all of your HTML files, JavaScript components, and any other templates for class names, generating the corresponding styles and then writing them to a static CSS file.

It’s fast, flexible, and reliable — with zero-runtime.

Installation

Use the Play CDN to try Tailwind right in the browser without any build step. The Play CDN is designed for development purposes only, and is not the best choice for production.

Play CDN - 图1

  1. Add the Play CDN script to your HTML

    Add the Play CDN script tag to the <head> of your HTML file, and start using Tailwind’s utility classes to style your content.

    Play CDN - 图2

  2. Try customizing your config

    Edit the tailwind.config object to customize your configuration with your own design tokens.

    Play CDN - 图3

  3. Try adding some custom CSS

    Use type="text/tailwindcss" to add custom CSS that supports all of Tailwind’s CSS features.

    Play CDN - 图4

Get familiar with some of the core concepts that make Tailwind CSS different from writing traditional CSS.

  • Play CDN - 图5

    Utility-First Fundamentals

    Using a utility-first workflow to build complex components from a constrained set of primitive utilities.

  • Play CDN - 图6

    Responsive Design

    Build fully responsive user interfaces that adapt to any screen size using responsive modifiers.

  • Play CDN - 图7

    Hover, Focus & Other States

    Style elements in interactive states like hover, focus, and more using conditional modifiers.

  • Play CDN - 图8

    Dark Mode

    Optimize your site for dark mode directly in your HTML using the dark mode modifier.

  • Play CDN - 图9

    Reusing Styles

    Manage duplication and keep your projects maintainable by creating reusable abstractions.

  • Play CDN - 图10

    Customizing the Framework

    Customize the framework to match your brand and extend it with your own custom styles.