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

- What is Tailwind CSS?
- The description of Footer ui component
- Why use Tailwind CSS to build a Footer ui component?
- The preview of Footer ui component
- The source code of Footer ui component
- How to build a Footer with Tailwind CSS?
- Install tailwind css of verion 3.0.18
- All the unility class needed to build a Footer component
- 49 steps to build a Footer component with Tailwind CSS
- Conclusion
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.
The description of Footer ui component
Footer
Why use Tailwind CSS to build a Footer ui component?
- 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.
The preview of Footer ui component
Free download of the Footer's source code
The source code of Footer ui component
<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>
How to build a Footer with Tailwind CSS?
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>
All the unility class needed to build a Footer component
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
49 steps to build a Footer component with Tailwind CSS
Control the text color of an element to gray-600 using the
text-gray-600
utilities.Control the horizontal padding of an element to 1.25rem using the
px-5
utilities.Control the vertical padding of an element to 6rem using the
py-24
utilities.Control the horizontal margin of an element to auto using the
mx-auto
utilities.Use
flex
to create a block-level flex container.Use
flex
to create a block-level flex container at only medium screen sizes.Use
flex
to create a block-level flex container at only medium screen sizes.Use
flex
to create a block-level flex container.Use
flex
to create a block-level flex container.Use
w-64
to set an element to a fixed width(16rem).Use
flex
to create a block-level flex container.Control the horizontal margin of an element to 0rem at only medium screen sizes using the
md:mx-0
utilities.Control the text color of an element to center using the
text-center
utilities.Control the text color of an element to left at only medium screen sizes using the
md:text-left
utilities.Control the margin on top side of an element to 0rem at only medium screen sizes using the
md:mt-0
utilities.Control the margin on top side of an element to 2.5rem using the
mt-10
utilities.Use
justify-start
to justify items against the start of the container’s main axis at only medium screen sizes.Control the text color of an element to gray-900 using the
text-gray-900
utilities.Use
w-10
to set an element to a fixed width(2.5rem).Use
h-10
to set an element to a fixed height(2.5rem).Control the text color of an element to white using the
text-white
utilities.Control the padding on all sides of an element to 0.5rem using the
p-2
utilities.Control the background color of an element to indigo-500 using the
bg-indigo-500
utilities.Control the margin on left side of an element to 0.75rem using the
ml-3
utilities.Control the text color of an element to xl using the
text-xl
utilities.Control the margin on top side of an element to 0.5rem using the
mt-2
utilities.Control the text color of an element to sm using the
text-sm
utilities.Control the text color of an element to gray-500 using the
text-gray-500
utilities.Use
flex
to create a block-level flex container.Control the padding on right side of an element to 5rem at only medium screen sizes using the
md:pr-20
utilities.Control the margin on bottom side of an element to -2.5rem using the
-mb-10
utilities.Use
lg:w-1/4
to set an element to a fixed width(1/4) at only large screen sizes.Use
md:w-1/2
to set an element to a fixed width(1/2) at only medium screen sizes.Use
w-full
to set an element to a 100% based width.Control the horizontal padding of an element to 1rem using the
px-4
utilities.Control the margin on bottom side of an element to 0.75rem using the
mb-3
utilities.Control the margin on bottom side of an element to 2.5rem using the
mb-10
utilities.Control the text color of an element to gray-800 on hover using the
hover:text-gray-800
utilities.Control the background color of an element to gray-100 using the
bg-gray-100
utilities.Control the vertical padding of an element to 1rem using the
py-4
utilities.Use
flex
to create a block-level flex container at only small screen sizes.Control the text color of an element to left at only small screen sizes using the
sm:text-left
utilities.Control the margin on left side of an element to 0.25rem using the
ml-1
utilities.Use
inline-flex
to create an inline flex container that flows with text.Control the margin on left side of an element to auto at only small screen sizes using the
sm:ml-auto
utilities.Control the margin on top side of an element to 0rem at only small screen sizes using the
sm:mt-0
utilities.Use
justify-start
to justify items against the start of the container’s main axis at only small screen sizes.Use
w-5
to set an element to a fixed width(1.25rem).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.