Published on

The 5 Really Obvious Ways To Create A Footer With Tailwind CSS Better That You Ever Did

Footer

What is Tailwind CSS?

Tailwind CSS is a utility-first CSS framework that focuses on creating personalized user interfaces quickly. It can gives you all the building blocks you are able to create personalized designs without having to fight to override irritating opinionated styles. Also, Tailwind CSS is a highly configurable, low-level CSS framework.

Footer

  • It can make the building process of Footer ui component faster and more easily.
  • Enables building complex responsive layouts and components freely.
  • Minimum lines of CSS code in Footer component file.

Free download of the Footer's source code

<footer class="text-gray-600 body-font">
  <div class="container px-5 py-24 mx-auto flex md:items-center lg:items-start md:flex-row md:flex-nowrap flex-wrap flex-col">
    <div class="w-64 flex-shrink-0 md:mx-0 mx-auto text-center md:text-left md:mt-0 mt-10">
      <a class="flex title-font font-medium items-center md:justify-start justify-center text-gray-900">
        <svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="w-10 h-10 text-white p-2 bg-indigo-500 rounded-full" viewBox="0 0 24 24">
          <path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"></path>
        </svg>
        <span class="ml-3 text-xl">Footer</span>
      </a>
      <p class="mt-2 text-sm text-gray-500">Air plant banjo lyft occupy retro adaptogen indego</p>
    </div>
    <div class="flex-grow flex flex-wrap md:pr-20 -mb-10 md:text-left text-center order-first">
      <div class="lg:w-1/4 md:w-1/2 w-full px-4">
        <h2 class="title-font font-medium text-gray-900 tracking-widest text-sm mb-3">CATEGORIES</h2>
        <nav class="list-none mb-10">
          <li>
            <a class="text-gray-600 hover:text-gray-800">First Link</a>
          </li>
          <li>
            <a class="text-gray-600 hover:text-gray-800">Second Link</a>
          </li>
          <li>
            <a class="text-gray-600 hover:text-gray-800">Third Link</a>
          </li>
          <li>
            <a class="text-gray-600 hover:text-gray-800">Fourth Link</a>
          </li>
        </nav>
      </div>
      <div class="lg:w-1/4 md:w-1/2 w-full px-4">
        <h2 class="title-font font-medium text-gray-900 tracking-widest text-sm mb-3">CATEGORIES</h2>
        <nav class="list-none mb-10">
          <li>
            <a class="text-gray-600 hover:text-gray-800">First Link</a>
          </li>
          <li>
            <a class="text-gray-600 hover:text-gray-800">Second Link</a>
          </li>
          <li>
            <a class="text-gray-600 hover:text-gray-800">Third Link</a>
          </li>
          <li>
            <a class="text-gray-600 hover:text-gray-800">Fourth Link</a>
          </li>
        </nav>
      </div>
      <div class="lg:w-1/4 md:w-1/2 w-full px-4">
        <h2 class="title-font font-medium text-gray-900 tracking-widest text-sm mb-3">CATEGORIES</h2>
        <nav class="list-none mb-10">
          <li>
            <a class="text-gray-600 hover:text-gray-800">First Link</a>
          </li>
          <li>
            <a class="text-gray-600 hover:text-gray-800">Second Link</a>
          </li>
          <li>
            <a class="text-gray-600 hover:text-gray-800">Third Link</a>
          </li>
          <li>
            <a class="text-gray-600 hover:text-gray-800">Fourth Link</a>
          </li>
        </nav>
      </div>
      <div class="lg:w-1/4 md:w-1/2 w-full px-4">
        <h2 class="title-font font-medium text-gray-900 tracking-widest text-sm mb-3">CATEGORIES</h2>
        <nav class="list-none mb-10">
          <li>
            <a class="text-gray-600 hover:text-gray-800">First Link</a>
          </li>
          <li>
            <a class="text-gray-600 hover:text-gray-800">Second Link</a>
          </li>
          <li>
            <a class="text-gray-600 hover:text-gray-800">Third Link</a>
          </li>
          <li>
            <a class="text-gray-600 hover:text-gray-800">Fourth Link</a>
          </li>
        </nav>
      </div>
    </div>
  </div>
  <div class="bg-gray-100">
    <div class="container mx-auto py-4 px-5 flex flex-wrap flex-col sm:flex-row">
      <p class="text-gray-500 text-sm text-center sm:text-left">© 2020 Footer —
        <a href="https://twitter.com/knyttneve" rel="noopener noreferrer" class="text-gray-600 ml-1" target="_blank">@MrsRobbot</a>
      </p>
      <span class="inline-flex sm:ml-auto sm:mt-0 mt-2 justify-center sm:justify-start">
        <a class="text-gray-500">
          <svg fill="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="w-5 h-5" viewBox="0 0 24 24">
            <path d="M18 2h-3a5 5 0 00-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 011-1h3z"></path>
          </svg>
        </a>
        <a class="ml-3 text-gray-500">
          <svg fill="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="w-5 h-5" viewBox="0 0 24 24">
            <path d="M23 3a10.9 10.9 0 01-3.14 1.53 4.48 4.48 0 00-7.86 3v1A10.66 10.66 0 013 4s-4 9 5 13a11.64 11.64 0 01-7 2c9 5 20 0 20-11.5a4.5 4.5 0 00-.08-.83A7.72 7.72 0 0023 3z"></path>
          </svg>
        </a>
        <a class="ml-3 text-gray-500">
          <svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="w-5 h-5" viewBox="0 0 24 24">
            <rect width="20" height="20" x="2" y="2" rx="5" ry="5"></rect>
            <path d="M16 11.37A4 4 0 1112.63 8 4 4 0 0116 11.37zm1.5-4.87h.01"></path>
          </svg>
        </a>
        <a class="ml-3 text-gray-500">
          <svg fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="0" class="w-5 h-5" viewBox="0 0 24 24">
            <path stroke="none" d="M16 8a6 6 0 016 6v7h-4v-7a2 2 0 00-2-2 2 2 0 00-2 2v7h-4v-7a6 6 0 016-6zM2 9h4v12H2z"></path>
            <circle cx="4" cy="4" r="2" stroke="none"></circle>
          </svg>
        </a>
      </span>
    </div>
  </div>
</footer>

Install tailwind css of verion 3.0.18

Use the script html tag to import the script of Tailwind CSS of the version 3.0.18

<script src="https://cdn.tailwindcss.com"></script>
  • text-gray-600
  • px-5
  • py-24
  • mx-auto
  • flex
  • md:flex-row
  • md:flex-nowrap
  • flex-wrap
  • flex-col
  • w-64
  • flex-shrink-0
  • md:mx-0
  • text-center
  • md:text-left
  • md:mt-0
  • mt-10
  • md:justify-start
  • text-gray-900
  • w-10
  • h-10
  • text-white
  • p-2
  • bg-indigo-500
  • ml-3
  • text-xl
  • mt-2
  • text-sm
  • text-gray-500
  • flex-grow
  • md:pr-20
  • -mb-10
  • lg:w-1/4
  • md:w-1/2
  • w-full
  • px-4
  • mb-3
  • mb-10
  • hover:text-gray-800
  • bg-gray-100
  • py-4
  • sm:flex-row
  • sm:text-left
  • ml-1
  • inline-flex
  • sm:ml-auto
  • sm:mt-0
  • sm:justify-start
  • w-5
  • h-5
  1. Control the text color of an element to gray-600 using the text-gray-600 utilities.

  2. Control the horizontal padding of an element to 1.25rem using the px-5 utilities.

  3. Control the vertical padding of an element to 6rem using the py-24 utilities.

  4. Control the horizontal margin of an element to auto using the mx-auto utilities.

  5. Use flex to create a block-level flex container.

  6. Use flex to create a block-level flex container at only medium screen sizes.

  7. Use flex to create a block-level flex container at only medium screen sizes.

  8. Use flex to create a block-level flex container.

  9. Use flex to create a block-level flex container.

  10. Use w-64 to set an element to a fixed width(16rem).

  11. Use flex to create a block-level flex container.

  12. Control the horizontal margin of an element to 0rem at only medium screen sizes using the md:mx-0 utilities.

  13. Control the text color of an element to center using the text-center utilities.

  14. Control the text color of an element to left at only medium screen sizes using the md:text-left utilities.

  15. Control the margin on top side of an element to 0rem at only medium screen sizes using the md:mt-0 utilities.

  16. Control the margin on top side of an element to 2.5rem using the mt-10 utilities.

  17. Use justify-start to justify items against the start of the container’s main axis at only medium screen sizes.

  18. Control the text color of an element to gray-900 using the text-gray-900 utilities.

  19. Use w-10 to set an element to a fixed width(2.5rem).

  20. Use h-10 to set an element to a fixed height(2.5rem).

  21. Control the text color of an element to white using the text-white utilities.

  22. Control the padding on all sides of an element to 0.5rem using the p-2 utilities.

  23. Control the background color of an element to indigo-500 using the bg-indigo-500 utilities.

  24. Control the margin on left side of an element to 0.75rem using the ml-3 utilities.

  25. Control the text color of an element to xl using the text-xl utilities.

  26. Control the margin on top side of an element to 0.5rem using the mt-2 utilities.

  27. Control the text color of an element to sm using the text-sm utilities.

  28. Control the text color of an element to gray-500 using the text-gray-500 utilities.

  29. Use flex to create a block-level flex container.

  30. Control the padding on right side of an element to 5rem at only medium screen sizes using the md:pr-20 utilities.

  31. Control the margin on bottom side of an element to -2.5rem using the -mb-10 utilities.

  32. Use lg:w-1/4 to set an element to a fixed width(1/4) at only large screen sizes.

  33. Use md:w-1/2 to set an element to a fixed width(1/2) at only medium screen sizes.

  34. Use w-full to set an element to a 100% based width.

  35. Control the horizontal padding of an element to 1rem using the px-4 utilities.

  36. Control the margin on bottom side of an element to 0.75rem using the mb-3 utilities.

  37. Control the margin on bottom side of an element to 2.5rem using the mb-10 utilities.

  38. Control the text color of an element to gray-800 on hover using the hover:text-gray-800 utilities.

  39. Control the background color of an element to gray-100 using the bg-gray-100 utilities.

  40. Control the vertical padding of an element to 1rem using the py-4 utilities.

  41. Use flex to create a block-level flex container at only small screen sizes.

  42. Control the text color of an element to left at only small screen sizes using the sm:text-left utilities.

  43. Control the margin on left side of an element to 0.25rem using the ml-1 utilities.

  44. Use inline-flex to create an inline flex container that flows with text.

  45. Control the margin on left side of an element to auto at only small screen sizes using the sm:ml-auto utilities.

  46. Control the margin on top side of an element to 0rem at only small screen sizes using the sm:mt-0 utilities.

  47. Use justify-start to justify items against the start of the container’s main axis at only small screen sizes.

  48. Use w-5 to set an element to a fixed width(1.25rem).

  49. Use h-5 to set an element to a fixed height(1.25rem).

Conclusion

The above is a step-by-step tutorial on how to use Tailwind CSS to build a Footer components, learn and follow along to implement your own components.