Hello there!

Let's learn something today.

YOU'RE BUILDING

Pharmasift Part I

ROADMAP

Frontend

DIFFICULTY LEVEL

Beginner

Sections
0 / 33 Chapters Completed (0%)

2. Setting up Tailwind

Setting up Tailwind CSS with a CDN (Content Delivery Network) is a straightforward way to start using Tailwind in your web project without npm or complex configurations.

TIP - Senior developers usually read Official Documentation before implementing any tool. You should consider learning more about Tailwind here

Key Points:

  1. Linking Tailwind:

    • Including Tailwind CSS by adding a link in the HTML file's <head> section.

      <link
        href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css"
        rel="stylesheet"
      />
      
  2. Applying Tailwind Classes:

    • Start using Tailwind's utility classes directly in your HTML file to style elements effortlessly.

      <div class="p-4 bg-blue-500 text-white">Hello, Tailwind!</div>
      

Checking Tailwind Styling

After adding the Tailwind CDN link in your HTML file, create a sample element and apply a Tailwind class to see if it styles as expected.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Tailwind Test</title>
    <!-- Add Tailwind CSS via CDN -->
    <link
      href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css"
      rel="stylesheet"
    />
  </head>
  <body>
    <!-- Test Element -->
    <div class="p-4 bg-blue-500 text-white">
      Hello, Tailwind! This should be styled.
    </div>
  </body>
</html>

Save this HTML file and open it in a web browser. If Tailwind has been added successfully, the test element should be styled with a blue background, white text, and some padding.

đŸ„ł Wow. You just integrated & edited a Tailwind Website.

More interesting chapters ahead, Keep Going.