- Published on
What You Need To Make A Services Section With Tailwind CSS

- What is Tailwind CSS?
- The description of Services Section ui component
- Why use Tailwind CSS to create a Services Section ui component?
- The preview of Services Section ui component
- The source code of Services Section ui component
- How to create a Services Section with Tailwind CSS?
- Install tailwind css of verion 3.0.18
- All the unility class needed to create a Services Section component
- 37 steps to create a Services Section 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 Services Section ui component
Services section with svg icon by twitter.com/ari_budin
Why use Tailwind CSS to create a Services Section ui component?
- It can make the building process of Services Section ui component faster and more easily.
- Enables building complex responsive layouts and components freely.
- Minimum lines of CSS code in Services Section component file.
The preview of Services Section ui component
Free download of the Services Section's source code
The source code of Services Section ui component
<div id="services" class="section relative pt-20 pb-8 md:pt-16 md:pb-0 bg-white">
<div class="container xl:max-w-6xl mx-auto px-4">
<!-- Heading start -->
<header class="text-center mx-auto mb-12 lg:px-20">
<h2 class="text-2xl leading-normal mb-2 font-bold text-black">What We Do</h2>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 60" style="margin: 0 auto;height: 35px;" xml:space="preserve">
<circle cx="50.1" cy="30.4" r="5" class="stroke-primary" style="fill: transparent;stroke-width: 2;stroke-miterlimit: 10;"></circle>
<line x1="55.1" y1="30.4" x2="100" y2="30.4" class="stroke-primary" style="stroke-width: 2;stroke-miterlimit: 10;"></line>
<line x1="45.1" y1="30.4" x2="0" y2="30.4" class="stroke-primary" style="stroke-width: 2;stroke-miterlimit: 10;"></line>
</svg>
<p class="text-gray-500 leading-relaxed font-light text-xl mx-auto pb-2">Save time managing advertising & Content for your business.</p>
</header>
<!-- End heading -->
<!-- row -->
<div class="flex flex-wrap flex-row -mx-4 text-center">
<div class="flex-shrink px-4 max-w-full w-full sm:w-1/2 lg:w-1/3 lg:px-6 wow fadeInUp" data-wow-duration="1s" style="visibility: visible; animation-duration: 1s; animation-name: fadeInUp;">
<!-- service block -->
<div class="py-8 px-12 mb-12 bg-gray-50 border-b border-gray-100 transform transition duration-300 ease-in-out hover:-translate-y-2">
<div class="inline-block text-gray-900 mb-4">
<!-- icon -->
<svg xmlns="http://www.w3.org/2000/svg" width="2rem" height="2rem" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"></path>
</svg>
</div>
<h3 class="text-lg leading-normal mb-2 font-semibold text-black">SEO Services</h3>
<p class="text-gray-500">This is a wider card with supporting text below as a natural content.</p>
</div>
<!-- end service block -->
</div>
<div class="flex-shrink px-4 max-w-full w-full sm:w-1/2 lg:w-1/3 lg:px-6 wow fadeInUp" data-wow-duration="1s" data-wow-delay=".1s" style="visibility: visible; animation-duration: 1s; animation-delay: 0.1s; animation-name: fadeInUp;">
<!-- service block -->
<div class="py-8 px-12 mb-12 bg-gray-50 border-b border-gray-100 transform transition duration-300 ease-in-out hover:-translate-y-2">
<div class="inline-block text-gray-900 mb-4">
<!-- icon -->
<svg xmlns="http://www.w3.org/2000/svg" width="2rem" height="2rem" fill="currentColor" class="bi bi-chat-square-dots" viewBox="0 0 16 16">
<path d="M14 1a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1h-2.5a2 2 0 0 0-1.6.8L8 14.333 6.1 11.8a2 2 0 0 0-1.6-.8H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2.5a1 1 0 0 1 .8.4l1.9 2.533a1 1 0 0 0 1.6 0l1.9-2.533a1 1 0 0 1 .8-.4H14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"></path>
<path d="M5 6a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm4 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm4 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"></path>
</svg>
</div>
<h3 class="text-lg leading-normal mb-2 font-semibold text-black">Social Content</h3>
<p class="text-gray-500">This is a wider card with supporting text below as a natural content.</p>
</div>
<!-- end service block -->
</div>
<div class="flex-shrink px-4 max-w-full w-full sm:w-1/2 lg:w-1/3 lg:px-6 wow fadeInUp" data-wow-duration="1s" data-wow-delay=".3s" style="visibility: visible; animation-duration: 1s; animation-delay: 0.3s; animation-name: fadeInUp;">
<!-- service block -->
<div class="py-8 px-12 mb-12 bg-gray-50 border-b border-gray-100 transform transition duration-300 ease-in-out hover:-translate-y-2">
<div class="inline-block text-gray-900 mb-4">
<!-- icon -->
<svg xmlns="http://www.w3.org/2000/svg" width="2rem" height="2rem" fill="currentColor" class="bi bi-badge-ad" viewBox="0 0 16 16">
<path d="M3.7 11l.47-1.542h2.004L6.644 11h1.261L5.901 5.001H4.513L2.5 11h1.2zm1.503-4.852l.734 2.426H4.416l.734-2.426h.053zm4.759.128c-1.059 0-1.753.765-1.753 2.043v.695c0 1.279.685 2.043 1.74 2.043.677 0 1.222-.33 1.367-.804h.057V11h1.138V4.685h-1.16v2.36h-.053c-.18-.475-.68-.77-1.336-.77zm.387.923c.58 0 1.002.44 1.002 1.138v.602c0 .76-.396 1.2-.984 1.2-.598 0-.972-.449-.972-1.248v-.453c0-.795.37-1.24.954-1.24z"></path>
<path d="M14 3a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h12zM2 2a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H2z"></path>
</svg>
</div>
<h3 class="text-lg leading-normal mb-2 font-semibold text-black">Creative ads</h3>
<p class="text-gray-500">This is a wider card with supporting text below as a natural content.</p>
</div>
<!-- end service block -->
</div>
<div class="flex-shrink px-4 max-w-full w-full sm:w-1/2 lg:w-1/3 lg:px-6 wow fadeInUp" data-wow-duration="1s" style="visibility: visible; animation-duration: 1s; animation-name: fadeInUp;">
<!-- service block -->
<div class="py-8 px-12 mb-12 bg-gray-50 border-b border-gray-100 transform transition duration-300 ease-in-out hover:-translate-y-2">
<div class="inline-block text-gray-900 mb-4">
<!-- icon -->
<svg xmlns="http://www.w3.org/2000/svg" width="2rem" height="2rem" fill="currentColor" class="bi bi-card-checklist" viewBox="0 0 16 16">
<path d="M14.5 3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-13a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h13zm-13-1A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h13a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2h-13z"></path>
<path d="M7 5.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5zm-1.496-.854a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 1 1 .708-.708l.146.147 1.146-1.147a.5.5 0 0 1 .708 0zM7 9.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5zm-1.496-.854a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 0 1 .708-.708l.146.147 1.146-1.147a.5.5 0 0 1 .708 0z"></path>
</svg>
</div>
<h3 class="text-lg leading-normal mb-2 font-semibold text-black">Brand Identity</h3>
<p class="text-gray-500">This is a wider card with supporting text below as a natural content.</p>
</div>
<!-- end service block -->
</div>
<div class="flex-shrink px-4 max-w-full w-full sm:w-1/2 lg:w-1/3 lg:px-6 wow fadeInUp" data-wow-duration="1s" data-wow-delay=".1s" style="visibility: visible; animation-duration: 1s; animation-delay: 0.1s; animation-name: fadeInUp;">
<!-- service block -->
<div class="py-8 px-12 mb-12 bg-gray-50 border-b border-gray-100 transform transition duration-300 ease-in-out hover:-translate-y-2">
<div class="inline-block text-gray-900 mb-4">
<!-- icon -->
<svg xmlns="http://www.w3.org/2000/svg" width="2rem" height="2rem" fill="currentColor" class="bi bi-wallet2" viewBox="0 0 16 16">
<path d="M12.136.326A1.5 1.5 0 0 1 14 1.78V3h.5A1.5 1.5 0 0 1 16 4.5v9a1.5 1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 0 13.5v-9a1.5 1.5 0 0 1 1.432-1.499L12.136.326zM5.562 3H13V1.78a.5.5 0 0 0-.621-.484L5.562 3zM1.5 4a.5.5 0 0 0-.5.5v9a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-9a.5.5 0 0 0-.5-.5h-13z"></path>
</svg>
</div>
<h3 class="text-lg leading-normal mb-2 font-semibold text-black">Budget & Marketing</h3>
<p class="text-gray-500">This is a wider card with supporting text below as a natural content.</p>
</div>
<!-- end service block -->
</div>
<div class="flex-shrink px-4 max-w-full w-full sm:w-1/2 lg:w-1/3 lg:px-6 wow fadeInUp" data-wow-duration="1s" data-wow-delay=".3s" style="visibility: visible; animation-duration: 1s; animation-delay: 0.3s; animation-name: fadeInUp;">
<!-- service block -->
<div class="py-8 px-12 mb-12 bg-gray-50 border-b border-gray-100 transform transition duration-300 ease-in-out hover:-translate-y-2">
<div class="inline-block text-gray-900 mb-4">
<!-- icon -->
<svg xmlns="http://www.w3.org/2000/svg" width="2rem" height="2rem" fill="currentColor" class="bi bi-funnel" viewBox="0 0 16 16">
<path d="M1.5 1.5A.5.5 0 0 1 2 1h12a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.128.334L10 8.692V13.5a.5.5 0 0 1-.342.474l-3 1A.5.5 0 0 1 6 14.5V8.692L1.628 3.834A.5.5 0 0 1 1.5 3.5v-2zm1 .5v1.308l4.372 4.858A.5.5 0 0 1 7 8.5v5.306l2-.666V8.5a.5.5 0 0 1 .128-.334L13.5 3.308V2h-11z"></path>
</svg>
</div>
<h3 class="text-lg leading-normal mb-2 font-semibold text-black">Optimize conversions</h3>
<p class="text-gray-500">This is a wider card with supporting text below as a natural content.</p>
</div>
<!-- end service block -->
</div>
</div>
<!-- end row -->
</div>
</div>
How to create a Services Section 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 create a Services Section component
relative
pt-20
pb-8
md:pt-16
md:pb-0
bg-white
xl:max-w-6xl
mx-auto
px-4
text-center
mb-12
lg:px-20
text-2xl
mb-2
text-black
text-gray-500
text-xl
pb-2
flex
flex-wrap
flex-row
-mx-4
flex-shrink
max-w-full
w-full
sm:w-1/2
lg:w-1/3
lg:px-6
py-8
px-12
bg-gray-50
border-b
border-gray-100
inline-block
text-gray-900
mb-4
text-lg
37 steps to create a Services Section component with Tailwind CSS
Use
relative
to position an element according to the normal flow of the document.Control the padding on top side of an element to 5rem using the
pt-20
utilities.Control the padding on bottom side of an element to 2rem using the
pb-8
utilities.Control the padding on top side of an element to 4rem at only medium screen sizes using the
md:pt-16
utilities.Control the padding on bottom side of an element to 0rem at only medium screen sizes using the
md:pb-0
utilities.Control the background color of an element to white using the
bg-white
utilities.Set the maximum width/height of an element using the
xl:max-w-6xl
utilities at only extremely large screen sizes.Control the horizontal margin of an element to auto using the
mx-auto
utilities.Control the horizontal padding of an element to 1rem using the
px-4
utilities.Control the text color of an element to center using the
text-center
utilities.Control the margin on bottom side of an element to 3rem using the
mb-12
utilities.Control the horizontal padding of an element to 5rem at only large screen sizes using the
lg:px-20
utilities.Control the text color of an element to 2xl using the
text-2xl
utilities.Control the margin on bottom side of an element to 0.5rem using the
mb-2
utilities.Control the text color of an element to black using the
text-black
utilities.Control the text color of an element to gray-500 using the
text-gray-500
utilities.Control the text color of an element to xl using the
text-xl
utilities.Control the padding on bottom side of an element to 0.5rem using the
pb-2
utilities.Use
flex
to create a block-level flex container.Use
flex
to create a block-level flex container.Use
flex
to create a block-level flex container.Control the horizontal margin of an element to -1rem using the
-mx-4
utilities.Use
flex
to create a block-level flex container.Set the maximum width/height of an element using the
max-w-full
utilities.Use
w-full
to set an element to a 100% based width.Use
sm:w-1/2
to set an element to a fixed width(1/2) at only small screen sizes.Use
lg:w-1/3
to set an element to a fixed width(1/3) at only large screen sizes.Control the horizontal padding of an element to 1.5rem at only large screen sizes using the
lg:px-6
utilities.Control the vertical padding of an element to 2rem using the
py-8
utilities.Control the horizontal padding of an element to 3rem using the
px-12
utilities.Control the background color of an element to gray-50 using the
bg-gray-50
utilities.Control the border color of an element to b using the
border-b
utilities.Control the border color of an element to gray-100 using the
border-gray-100
utilities.Use
inline-block
utilities to wrap the element to prevent the text inside from extending beyond its parent.Control the text color of an element to gray-900 using the
text-gray-900
utilities.Control the margin on bottom side of an element to 1rem using the
mb-4
utilities.Control the text color of an element to lg using the
text-lg
utilities.
Conclusion
The above is a step-by-step tutorial on how to use Tailwind CSS to create a Services Section components, learn and follow along to implement your own components.