- Published on
3 Things You Must Know To Build A Leading Pages With Tailwind CSS

- What is Tailwind CSS?
- The description of Leading pages ui component
- Why use Tailwind CSS to create a Leading pages ui component?
- The preview of Leading pages ui component
- The source code of Leading pages ui component
- How to create a Leading pages with Tailwind CSS?
- Install tailwind css of verion 2.2.4
- All the unility class needed to create a Leading pages component
- 64 steps to create a Leading pages 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 Leading pages ui component
Semoga bermanfaat untuk semua
Why use Tailwind CSS to create a Leading pages ui component?
- It can make the building process of Leading pages ui component faster and more easily.
- Enables building complex responsive layouts and components freely.
- Minimum lines of CSS code in Leading pages component file.
The preview of Leading pages ui component
Free download of the Leading pages's source code
The source code of Leading pages ui component
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<div class="bg-red-500 w-full">
<header>
<div class="flex justify-between items-center py-4 px-6">
<div>
<h1 class="font-bold text-white text-3xl">SA<span class="text-blue-400">-LOGO</span></h1>
</div>
<div class="flex justify-center space-x-10 hidden sm:block">
<a href="#" class="text-white font-semibold text-lg hover:text-yellow-400">Home</a>
<a href="#" class="text-white font-semibold text-lg hover:text-yellow-400">About</a>
<a href="#" class="text-white font-semibold text-lg hover:text-yellow-400">Contact</a>
</div>
<div class="flex space-x-2 space-x-10 hidden sm:block">
<button
class="bg-gradient-to-b from-yellow-400 to-yellow-500 text-white font-bold py-2 px-4 rounded-lg uppercase text-sm shadow-xl">
HIRE US
</button>
</div>
<div class="flex space-x-2 space-x-10 block sm:hidden">
<a href="#"
class="flex items-center bg-gradient-to-b from-yellow-400 to-yellow-500 text-white font-bold py-2 px-4 rounded-full uppercase text-sm shadow-xl">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h8m-8 6h16" />
</svg>
</a>
</div>
</div>
</header>
<!-- Title -->
<section class="h-screen px-12 sm:px-24 flex items-center relative">
<div class="grid grid-cols-12 gap-6 ">
<div class="col-span-12 sm:col-span-12 md:col-span-12 lg:col-span-8 xxl:col-span-12">
<div class="w-full">
<h1 class="text-7xl sm:text-8xl lg:text-8xl xl:text-9xl text-white font-bold my-8">Bring Your<br>
Ideas to <span class="text-blue-400">Life</span></h1>
<p class="text-xl text-white font-semibold ">Become the best in your industry!<br> Start today
our universal quik start program</p>
</div>
</div>
<div class="absolute bottom-0 left-0 py-6 px-6">
<div class="flex space-x-2">
<svg xmlns="http://www.w3.org/2000/svg" class="h-7 w-7 text-yellow-400" fill="none"
viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M13 9l3 3m0 0l-3 3m3-3H8m13 0a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
<p class="text-white font-semibold">Explore</p>
</div>
</div>
<div class="absolute bottom-0 py-6 px-6 right-0">
<div class="flex space-x-6">
<i class="fa fa-dribbble text-white fa-lg"></i>
<i class="fa fa-twitter text-white fa-lg"></i>
<i class="fa fa-facebook text-white fa-lg"></i>
<i class="fa fa-instagram text-white fa-lg"></i>
</div>
</div>
</div>
</section>
<!-- WE CREATE -->
<section class="h-full bg-yellow-300">
<div class="relative px-8 py-8">
<div>
<h1 class="text-white text-white text-6xl font-bold">
<span class="bg-blue-400 py-4 px-4 rounded-full text-5xl">WE</span>CREATE
</h1>
</div>
</div>
<div class="grid grid-cols-12 gap-6 px-8 py-8">
<div class="col-span-12 sm:col-span-12 md:col-span-5 lg:col-span-5 xxl:col-span-5">
<div class="py-4">
<p class="text-lg font-semibold text-blue-900"><span class="text-red-400 font-bold">01-</span>
OPTIMIZED <span class="font-bold">USER EXPERIENCES</span></p>
<p class="text-blue-900 text-sm pl-8">Lorem Ipsum is simply dummy text of the printing and
typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since
the 1500s, when an unknown printer took a galley of type and scrambled it to make a
type specimen book.
</p>
</div>
<div class="py-4">
<p class="text-lg font-semibold text-blue-900"><span class="text-red-400 font-bold">02-</span>
ELEGENT <span class="font-bold">USER INTERFACES</span></p>
</div>
<div class="py-4">
<p class="text-lg font-semibold text-blue-900"><span class="text-red-400 font-bold">03-</span>
BEAUTIFUL <span class="font-bold">GRAPHIC DESIGNS</span></p>
</div>
<div class="py-4">
<p class="text-lg font-semibold text-blue-900"><span class="text-red-400 font-bold">04-</span>
TACTICAL <span class="font-bold">DIGITAL MARKETING</span></p>
</div>
</div>
<div class="col-span-12 sm:col-span-12 md:col-span-7 lg:col-span-7 xxl:col-span-7 flex justify-center">
<img src="https://cdn3d.iconscout.com/3d/premium/thumb/male-employee-looking-at-customer-review-2937682-2426381.png"
class="w-auto" />
</div>
</div>
</section>
<!-- Grow With Us -->
<section class="h-full bg-yellow-300">
<div class="grid grid-cols-12 gap-0">
<div
class="col-span-12 sm:col-span-12 md:col-span-6 lg:col-span-6 xxl:col-span-6 bg-red-500 h-full px-16 py-6">
<div>
<img src="https://ouch-cdn2.icons8.com/c_sJhjs8JZ9WhtxfMnw0Eh2FpwIsj4VukdWjkjOiJqw/rs:fit:784:784/czM6Ly9pY29uczgu/b3VjaC1wcm9kLmFz/c2V0cy9wbmcvMjEx/LzZkY2MyYWU2LWU5/MDYtNDJjNC05Yzk3/LTBiYjliMDgxOGMz/MC5wbmc.png" class="w-52 -ml-4" />
<h1 class="text-white font-semibold text-7xl">Grow With Us</h1>
<button
class="my-6 bg-gradient-to-b from-yellow-400 to-yellow-500 text-white font-bold py-2 px-4 rounded-lg uppercase text-sm shadow-xl">
Hire Us
</button>
</div>
</div>
<div
class="col-span-12 sm:col-span-12 md:col-span-6 lg:col-span-6 xxl:col-span-6 bg-blue-400 h-full px-16 py-6">
<div>
<img src="https://assets.materialup.com/uploads/641e0e0f-eddf-4d2c-b0ee-c6f55300bb1b/preview.png"
class="w-52 -ml-10" />
<h1 class="text-white font-semibold text-7xl">Say Hello</h1>
<button
class="my-6 bg-gradient-to-b from-red-400 to-red-500 text-white font-bold py-2 px-4 rounded-lg uppercase text-sm shadow-xl">
[email protected]
</button>
</div>
</div>
</div>
</section>
<!-- footer -->
<section class="h-full bg-gray-800">
<div class="py-6 px-16 flex justify-between">
<div>
<h1 class="font-bold text-white text-xl">SA<span class="text-blue-400">-LOGO</span></h1>
</div>
<div class="flex space-x-6 mt-2">
<i class="fa fa-dribbble text-white fa-lg"></i>
<i class="fa fa-twitter text-white fa-lg"></i>
<i class="fa fa-facebook text-white fa-lg"></i>
<i class="fa fa-instagram text-white fa-lg"></i>
</div>
</div>
<div class="border-t-2 mx-10 border-gray-500"></div>
<div class="py-4 py-6 px-16 flex justify-between">
<div>
<h1 class="font-semibold text-white text-sm">Copyrigth @ 2021</h1>
</div>
<div>
<a href="#" class="flex space-x-2 text-white hover:text-yellow-400">
<p class="font-semibold text-sm">GO TOP</p>
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 -mt-1" fill="none" viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M8 7l4-4m0 0l4 4m-4-4v18" />
</svg>
</a>
</div>
</div>
</section>
</div>
</body>
</html>
How to create a Leading pages with Tailwind CSS?
Install tailwind css of verion 2.2.4
Use the script
html tag to import the script of Tailwind CSS of the version 2.2.4
<script src="https://cdn.tailwindcss.com"></script>
All the unility class needed to create a Leading pages component
bg-red-500
w-full
flex
py-4
px-6
text-white
text-3xl
text-blue-400
hidden
sm:block
text-lg
hover:text-yellow-400
bg-gradient-to-b
py-2
px-4
text-sm
block
sm:hidden
h-6
w-6
h-screen
px-12
sm:px-24
relative
grid
grid-cols-12
gap-6
text-7xl
sm:text-8xl
lg:text-8xl
xl:text-9xl
my-8
text-xl
absolute
bottom-0
left-0
py-6
h-7
w-7
text-yellow-400
right-0
h-full
bg-yellow-300
px-8
py-8
text-6xl
bg-blue-400
text-5xl
text-blue-900
text-red-400
pl-8
w-auto
gap-0
px-16
w-52
-ml-4
my-6
-ml-10
bg-gray-800
mt-2
border-t-2
mx-10
border-gray-500
-mt-1
64 steps to create a Leading pages component with Tailwind CSS
Control the background color of an element to red-500 using the
bg-red-500
utilities.Use
w-full
to set an element to a 100% based width.Use
flex
to create a block-level flex container.Control the vertical padding of an element to 1rem using the
py-4
utilities.Control the horizontal padding of an element to 1.5rem using the
px-6
utilities.Control the text color of an element to white using the
text-white
utilities.Control the text color of an element to 3xl using the
text-3xl
utilities.Control the text color of an element to blue-400 using the
text-blue-400
utilities.Use
hidden
to set an element to display: none and remove it from the page layout.Use
inline
utilities to put the element on its own line and fill its parent at only small screen sizes.Control the text color of an element to lg using the
text-lg
utilities.Control the text color of an element to yellow-400 on hover using the
hover:text-yellow-400
utilities.Control the background color of an element to gradient-to-b using the
bg-gradient-to-b
utilities.Control the vertical padding of an element to 0.5rem using the
py-2
utilities.Control the horizontal padding of an element to 1rem using the
px-4
utilities.Control the text color of an element to sm using the
text-sm
utilities.Use
inline
utilities to put the element on its own line and fill its parent.Use
hidden
to set an element to display: none and remove it from the page layout at only small screen sizes.Use
h-6
to set an element to a fixed height(1.5rem).Use
w-6
to set an element to a fixed width(1.5rem).Use
h-screen
to make an element span the entire height of the viewport.Control the horizontal padding of an element to 3rem using the
px-12
utilities.Control the horizontal padding of an element to 6rem at only small screen sizes using the
sm:px-24
utilities.Use
relative
to position an element according to the normal flow of the document.Use
grid
to create a grid container.Use
grid
to create a grid container.To specify the width between columns, you can use the
gap-6
utilities.Control the text color of an element to 7xl using the
text-7xl
utilities.Control the text color of an element to 8xl at only small screen sizes using the
sm:text-8xl
utilities.Control the text color of an element to 8xl at only large screen sizes using the
lg:text-8xl
utilities.Control the text color of an element to 9xl at only extremely large screen sizes using the
xl:text-9xl
utilities.Control the vertical margin of an element to 2rem using the
my-8
utilities.Control the text color of an element to xl using the
text-xl
utilities.Use
absolute
to position an element outside of the normal flow of the document, causing neighboring elements to act as if the element doesn’t exist.Use the
bottom-0
utilities to set the bottom position of a positioned element to 0rem.Use the
left-0
utilities to set the left position of a positioned element to 0rem.Control the vertical padding of an element to 1.5rem using the
py-6
utilities.Use
h-7
to set an element to a fixed height(1.75rem).Use
w-7
to set an element to a fixed width(1.75rem).Control the text color of an element to yellow-400 using the
text-yellow-400
utilities.Use the
right-0
utilities to set the right position of a positioned element to 0rem.Use
h-full
to set an element’s height to 100% of its parent, as long as the parent has a defined height.Control the background color of an element to yellow-300 using the
bg-yellow-300
utilities.Control the horizontal padding of an element to 2rem using the
px-8
utilities.Control the vertical padding of an element to 2rem using the
py-8
utilities.Control the text color of an element to 6xl using the
text-6xl
utilities.Control the background color of an element to blue-400 using the
bg-blue-400
utilities.Control the text color of an element to 5xl using the
text-5xl
utilities.Control the text color of an element to blue-900 using the
text-blue-900
utilities.Control the text color of an element to red-400 using the
text-red-400
utilities.Adjust the left padding of the element to 2rem using the
pl-8
utilities classThe
w-auto
utility can be useful if you need to remove an element’s assigned width under a specific condition, like at a particular breakpoint.To specify the width between columns, you can use the
gap-0
utilities.Control the horizontal padding of an element to 4rem using the
px-16
utilities.Use
w-52
to set an element to a fixed width(13rem).Control the margin on left side of an element to -1rem using the
-ml-4
utilities.Control the vertical margin of an element to 1.5rem using the
my-6
utilities.Control the margin on left side of an element to -2.5rem using the
-ml-10
utilities.Control the background color of an element to gray-800 using the
bg-gray-800
utilities.Control the margin on top side of an element to 0.5rem using the
mt-2
utilities.Control the border color of an element to t-2 using the
border-t-2
utilities.Control the horizontal margin of an element to 2.5rem using the
mx-10
utilities.Control the border color of an element to gray-500 using the
border-gray-500
utilities.Control the margin on top side of an element to -0.25rem using the
-mt-1
utilities.
Conclusion
The above is a step-by-step tutorial on how to use Tailwind CSS to create a Leading pages components, learn and follow along to implement your own components.