- Published on
The Ultimate Guide To Help You Build A Simple template With Tailwind CSS

- What is Tailwind CSS?
- The description of Simple template ui component
- Why use Tailwind CSS to build a Simple template ui component?
- The preview of Simple template ui component
- The source code of Simple template ui component
- How to build a Simple template with Tailwind CSS?
- Install tailwind css of verion 1.0.4
- All the unility class needed to build a Simple template component
- 59 steps to build a Simple template 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 Simple template ui component
Simple template inspired in leno landing page
Why use Tailwind CSS to build a Simple template ui component?
- It can make the building process of Simple template ui component faster and more easily.
- Enables building complex responsive layouts and components freely.
- Minimum lines of CSS code in Simple template component file.
The preview of Simple template ui component
Free download of the Simple template's source code
The source code of Simple template ui component
<div class="text-white mt-0 border border-blue-800 py-0 w-full h-full" style="background-image:url('https://demos.onepagelove.com/html/leno/images/header-background.jpg')">
<header class="flex md:justify-between p-8">
<div class="flex align-items-center">
<svg class="sm:w-12 w-10 inline mr-3" fill="#00c9db" 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 586.5 586.5" xml:space="preserve"><polygon points="471.75,89.25 369.75,89.25 168.3,410.55 102,293.25 216.75,89.25 114.75,89.25 0,293.25 114.75,497.25 216.75,497.25 418.2,175.95 484.5,293.25 369.75,497.25 471.75,497.25 586.5,293.25"/></svg>
<h1 class="inline text-white sm:text-3xl text-2xl font-bold"><a href="/">My Company</a></h1>
</div>
<div class="lg:flex md:text-white hidden">
<ul class="align-items-center pt-2">
<li class="ml-4 p4"><a href="">Home</a></li>
<li class="ml-4 p4"><a href="">Features</a></li>
<li class="ml-4 p4"><a href="">Details</a></li>
<li class="ml-4 p4"><a href="">Preview</a></li>
<li class="ml-4 p4"><a href="">Contact</a></li>
</ul>
</div>
</header>
<section class="px-2 lg:px-0 mt-16 sm:mt-32 flex w-full container mx-auto pb-16">
<div class="w-full text-white flex justify-center md:justify-start text-center md:text-left">
<div class="md:w-1/2 w-full">
<h2 class="leading-none font-bold text-2xl xs:text-2x1 md:text-5xl lg:6x1 uppercase">Mobile app for <span class="text-blue-400">Marketers</span></h2>
<p class="mt-12 mb-12">This Landing is one is one of the easiest and feature packed marketing automation apps in the market. Download it today!</p>
<button class="px-16 rounded-full bg-blue-400 text-white font-bold p-4 uppercase border-blue-500 border">Download Now!</button>
</div>
<div class="md:w-1/2 md:justify-center md:flex hidden">
<img src="https://demos.onepagelove.com/html/leno/images/header-iphone.png" alt="Mobile Phone" />
</div>
</div>
</section>
<section class="bg-gray-900 sm:py-32 py-16">
<div class="container mx-auto sm:flex-row flex-col flex ">
<div class="sm:w-1/3 w-full sm:mb-0 mb-16">
<img src="https://demos.onepagelove.com/html/leno/images/testimonial-1.jpg" class="rounded-full w-24 h-24 mx-auto mb-2">
<p class="italic text-gray-500 text-center my-3">I just finished my trial period and was so amazed with the support and results that I purchased this template.</p>
<p class="font-bold text-gray-400 text-center text-xl">Sandy Grain - Designer</p>
</div>
<div class="sm:w-1/3 w-full sm:mb-0 mb-16">
<img src="https://demos.onepagelove.com/html/leno/images/testimonial-2.jpg" class="rounded-full w-24 h-24 mx-auto mb-2">
<p class="italic text-gray-500 text-center my-3">Searching for a great marketing automation app was difficult but thankfully I found this template.</p>
<p class="font-bold text-gray-400 text-center text-xl">Bruce Cashman - Developer</p>
</div>
<div class="sm:w-1/3 w-full sm:mb-0 mb-16">
<img src="https://demos.onepagelove.com/html/leno/images/testimonial-3.jpg" class="rounded-full w-24 h-24 mx-auto mb-2">
<p class="italic text-gray-500 text-center my-3">Who would have thought that this template can provide such amazing results in just a few weeks of use.</p>
<p class="font-bold text-gray-400 text-center text-xl">Amanda Savage - Administrator</p>
</div>
</div>
</section>
<section class="bg-gray-800 py-32">
<div class="container mx-auto">
<h1 class="text-5xl font-bold uppercase text-center text-gray-300">Features</h1>
<div class="flex justify-center">
<p class="w-1/2 text-center text-gray-300">This template was designed based on input from personal development coaches and popular trainers so it offers all</p>
</div>
</div>
</section>
</div>
How to build a Simple template with Tailwind CSS?
Install tailwind css of verion 1.0.4
Use the link
html tag to import the stylesheet of Tailwind CSS of the version 1.0.4
<link href=https://unpkg.com/[email protected]/dist/tailwind.min.css rel="stylesheet">
All the unility class needed to build a Simple template component
text-white
mt-0
border-blue-800
py-0
w-full
h-full
flex
p-8
sm:w-12
w-10
inline
mr-3
sm:text-3xl
text-2xl
lg:flex
md:text-white
hidden
pt-2
ml-4
px-2
lg:px-0
mt-16
sm:mt-32
mx-auto
pb-16
md:justify-start
text-center
md:text-left
md:w-1/2
xs:text-2x1
md:text-5xl
text-blue-400
mt-12
mb-12
px-16
bg-blue-400
p-4
border-blue-500
md:flex
bg-gray-900
sm:py-32
py-16
sm:flex-row
flex-col
sm:w-1/3
sm:mb-0
mb-16
w-24
h-24
mb-2
text-gray-500
my-3
text-gray-400
text-xl
bg-gray-800
py-32
text-5xl
text-gray-300
w-1/2
59 steps to build a Simple template component with Tailwind CSS
Control the text color of an element to white using the
text-white
utilities.Control the margin on top side of an element to 0rem using the
mt-0
utilities.Control the border color of an element to blue-800 using the
border-blue-800
utilities.Control the vertical padding of an element to 0rem using the
py-0
utilities.Use
w-full
to set an element to a 100% based width.Use
h-full
to set an element’s height to 100% of its parent, as long as the parent has a defined height.Use
flex
to create a block-level flex container.Control the padding on all sides of an element to 2rem using the
p-8
utilities.Use
sm:w-12
to set an element to a fixed width(3rem) at only small screen sizes.Use
w-10
to set an element to a fixed width(2.5rem).Use
inline
utilities to control the flow of text inside the element to wrap normally.Control the margin on right side of an element to 0.75rem using the
mr-3
utilities.Control the text color of an element to 3xl at only small screen sizes using the
sm:text-3xl
utilities.Control the text color of an element to 2xl using the
text-2xl
utilities.Use
flex
to create a block-level flex container at only large screen sizes.Control the text color of an element to white at only medium screen sizes using the
md:text-white
utilities.Use
hidden
to set an element to display: none and remove it from the page layout.Control the padding on top side of an element to 0.5rem using the
pt-2
utilities.Control the margin on left side of an element to 1rem using the
ml-4
utilities.Control the horizontal padding of an element to 0.5rem using the
px-2
utilities.Control the horizontal padding of an element to 0rem at only large screen sizes using the
lg:px-0
utilities.Control the margin on top side of an element to 4rem using the
mt-16
utilities.Control the margin on top side of an element to 8rem at only small screen sizes using the
sm:mt-32
utilities.Control the horizontal margin of an element to auto using the
mx-auto
utilities.Control the padding on bottom side of an element to 4rem using the
pb-16
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 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.Use
md:w-1/2
to set an element to a fixed width(1/2) at only medium screen sizes.Control the text color of an element to 2x1undefined using the
xs:text-2x1
utilities.Control the text color of an element to 5xl at only medium screen sizes using the
md:text-5xl
utilities.Control the text color of an element to blue-400 using the
text-blue-400
utilities.Control the margin on top side of an element to 3rem using the
mt-12
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 4rem using the
px-16
utilities.Control the background color of an element to blue-400 using the
bg-blue-400
utilities.Control the padding on all sides of an element to 1rem using the
p-4
utilities.Control the border color of an element to blue-500 using the
border-blue-500
utilities.Use
flex
to create a block-level flex container at only medium screen sizes.Control the background color of an element to gray-900 using the
bg-gray-900
utilities.Control the vertical padding of an element to 8rem at only small screen sizes using the
sm:py-32
utilities.Control the vertical padding of an element to 4rem using the
py-16
utilities.Use
flex
to create a block-level flex container at only small screen sizes.Use
flex
to create a block-level flex container.Use
sm:w-1/3
to set an element to a fixed width(1/3) at only small screen sizes.Control the margin on bottom side of an element to 0rem at only small screen sizes using the
sm:mb-0
utilities.Control the margin on bottom side of an element to 4rem using the
mb-16
utilities.Use
w-24
to set an element to a fixed width(6rem).Use
h-24
to set an element to a fixed height(6rem).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 gray-500 using the
text-gray-500
utilities.Control the vertical margin of an element to 0.75rem using the
my-3
utilities.Control the text color of an element to gray-400 using the
text-gray-400
utilities.Control the text color of an element to xl using the
text-xl
utilities.Control the background color of an element to gray-800 using the
bg-gray-800
utilities.Control the vertical padding of an element to 8rem using the
py-32
utilities.Control the text color of an element to 5xl using the
text-5xl
utilities.Control the text color of an element to gray-300 using the
text-gray-300
utilities.Use
w-1/2
to set an element to a fixed width(1/2).
Conclusion
The above is a step-by-step tutorial on how to use Tailwind CSS to build a Simple template components, learn and follow along to implement your own components.