#include tailwindcss
#html file
#web development
#tailwind’s utility classes

How do i add Tailwind CSS to html file?

Anonymous

AnonymousJan 08, 2024

In this post, we will learn how to add Tailwind CSS to html file?

Include Tailwind CSS via CDN

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

<script src="https://cdn.tailwindcss.com"></script>

After you’ve done that, you should be able to use the classes from Tailwind CSS. 

For Example:

<!doctype html>
<html>

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <script src="https://cdn.tailwindcss.com"></script>
</head>

<body>
  <h1 class="text-3xl font-bold underline">
    Hello world!
  </h1>
</body>

</html>

Output:

Happy Coding  😎