- Published on
Beginners Guide: Build A Landing Page With Tailwind CSS 2 With Tailwind CSS

- What is Tailwind CSS?
- The description of Landing Page with Tailwind CSS 2 ui component
- Why use Tailwind CSS to make a Landing Page with Tailwind CSS 2 ui component?
- The preview of Landing Page with Tailwind CSS 2 ui component
- The source code of Landing Page with Tailwind CSS 2 ui component
- How to make a Landing Page with Tailwind CSS 2 with Tailwind CSS?
- Install tailwind css of verion 1.0.4
- All the unility class needed to make a Landing Page with Tailwind CSS 2 component
- 160 steps to make a Landing Page with Tailwind CSS 2 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 Landing Page with Tailwind CSS 2 ui component
Inspired from a dribble shot by dribbble.com/shots/8807920-quickpay-hero-section/attachments/1015863?mode=media • codepen.io/mithicher/pen/jjorvyb
Why use Tailwind CSS to make a Landing Page with Tailwind CSS 2 ui component?
- It can make the building process of Landing Page with Tailwind CSS 2 ui component faster and more easily.
- Enables building complex responsive layouts and components freely.
- Minimum lines of CSS code in Landing Page with Tailwind CSS 2 component file.
The preview of Landing Page with Tailwind CSS 2 ui component
Free download of the Landing Page with Tailwind CSS 2's source code
The source code of Landing Page with Tailwind CSS 2 ui component
<!-- This is an example component -->
<div>
<div class="bg-indigo-900 px-4 py-4">
<div
class="md:max-w-6xl md:mx-auto md:flex md:items-center md:justify-between"
>
<div class="flex justify-between items-center">
<a href="#" class="inline-block py-2 text-white text-xl font-bold"
>Demopay</a
>
<div
class="inline-block cursor-pointer md:hidden">
<div class="bg-gray-400 w-8 mb-2" style="height: 2px;"></div>
<div class="bg-gray-400 w-8 mb-2" style="height: 2px;"></div>
<div class="bg-gray-400 w-8" style="height: 2px;"></div>
</div>
</div>
<div>
<div class="hidden md:block">
<a
href="#"
class="inline-block py-1 md:py-4 text-gray-100 mr-6 font-bold"
>How it Works</a
>
<a
href="#"
class="inline-block py-1 md:py-4 text-gray-500 hover:text-gray-100 mr-6"
>Services</a
>
<a
href="#"
class="inline-block py-1 md:py-4 text-gray-500 hover:text-gray-100"
>Blog</a
>
</div>
</div>
<div class="hidden md:block">
<a
href="#"
class="inline-block py-1 md:py-4 text-gray-500 hover:text-gray-100 mr-6"
>Login</a
>
<a
href="#"
class="inline-block py-2 px-4 text-gray-700 bg-white hover:bg-gray-100 rounded-lg"
>Sign Up</a
>
</div>
</div>
</div>
<div class="bg-indigo-900 md:overflow-hidden">
<div class="px-4 py-20 md:py-4">
<div class="md:max-w-6xl md:mx-auto">
<div class="md:flex md:flex-wrap">
<div class="md:w-1/2 text-center md:text-left md:pt-16">
<h1
class="font-bold text-white text-2xl md:text-5xl leading-tight mb-4"
>
Simple payment platform for any service
</h1>
<p class="text-indigo-200 md:text-xl md:pr-48">
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Id
vitae corrupti asperiores veritatis dolorum, commodi aperiam
enim.
</p>
<a
href="#"
class="mt-6 mb-12 md:mb-0 md:mt-10 inline-block py-3 px-8 text-white bg-red-500 hover:bg-red-600 rounded-lg shadow"
>Get Started</a
>
</div>
<div class="md:w-1/2 relative">
<div class="hidden md:block">
<div
class="-ml-24 -mb-40 absolute left-0 bottom-0 w-40 bg-white rounded-lg shadow-lg px-6 py-8"
style="transform: rotate(-8deg);"
>
<div
class="bg-indigo-800 mx-auto rounded-lg px-2 pb-2 relative mb-8"
>
<div class="mb-1">
<span
class="w-1 h-1 bg-indigo-100 rounded-full inline-block"
style="margin-right: 1px;"
></span
><span
class="w-1 h-1 bg-indigo-100 rounded-full inline-block"
style="margin-right: 1px;"
></span
><span
class="w-1 h-1 bg-indigo-100 rounded-full inline-block"
></span>
</div>
<div class="h-1 w-12 bg-indigo-100 rounded mb-1"></div>
<div class="h-1 w-10 bg-indigo-100 rounded mb-2"></div>
<div class="flex">
<div class="w-6 h-3 rounded bg-indigo-100 mr-1"></div>
<div class="w-6 h-3 rounded bg-indigo-100"></div>
</div>
<div
class="-mr-2 -mb-4 absolute bottom-0 right-0 h-16 w-10 rounded-lg bg-green-700 border-2 border-white"
></div>
<div
class="w-2 h-2 rounded-full bg-green-800 mx-auto absolute bottom-0 right-0 mr-2 -mb-2 z-10 border-2 border-white"
></div>
</div>
<div class="text-gray-800 text-center">
Online <br />Services
</div>
</div>
<div
class="ml-24 mb-16 absolute left-0 bottom-0 w-40 bg-white rounded-lg shadow-lg px-6 py-8"
style="transform: rotate(-8deg); z-index: 2;"
>
<div
class="bg-indigo-800 mx-auto rounded-lg relative mb-8 py-2 w-20 border-2 border-white"
>
<div
class="h-8 bg-green-700 w-8 rounded absolute left-0 top-0 -mt-3 ml-4"
style="transform: rotate(-45deg); z-index: -1;"
></div>
<div
class="h-8 bg-green-800 w-8 rounded absolute left-0 top-0 -mt-3 ml-8"
style="transform: rotate(-12deg); z-index: -2;"
></div>
<div
class="flex items-center justify-center h-6 bg-indigo-800 w-6 rounded-l-lg ml-auto border-4 border-white -mr-1"
>
<div
class="h-2 w-2 rounded-full bg-indigo-800 border-2 border-white"
></div>
</div>
<div
class="w-8 h-8 bg-green-700 border-4 border-white rounded-full -ml-3 -mb-5"
></div>
</div>
<div class="text-gray-800 text-center">
Banking Services
</div>
</div>
<div
class="ml-32 absolute left-0 bottom-0 w-48 bg-white rounded-lg shadow-lg px-10 py-8"
style="transform: rotate(-8deg); z-index: 2; margin-bottom: -220px;"
>
<div
class="bg-indigo-800 mx-auto rounded-lg pt-4 mb-16 relative"
>
<div class="h-4 bg-white"></div>
<div class="text-right my-2 pb-1">
<div
class="inline-flex w-3 h-3 rounded-full bg-white -mr-2"
></div>
<div
class="inline-flex w-3 h-3 rounded-full bg-indigo-800 border-2 border-white mr-2"
></div>
</div>
<div
class="-ml-4 -mb-6 absolute left-0 bottom-0 w-16 bg-green-700 mx-auto rounded-lg pb-2 pt-3"
>
<div class="h-2 bg-white mb-2"></div>
<div class="h-2 bg-white w-6 ml-auto rounded mr-2"></div>
</div>
</div>
<div class="text-gray-800 text-center">
Payment for <br />Internet
</div>
</div>
<div
class="mt-10 w-full absolute right-0 top-0 flex rounded-lg bg-white overflow-hidden shadow-lg"
style="transform: rotate(-8deg); margin-right: -250px; z-index: 1;"
>
<div class="w-32 bg-gray-200" style="height: 560px;"></div>
<div class="flex-1 p-6">
<h2 class="text-lg text-gray-700 font-bold mb-3">
Popular Payments
</h2>
<div class="flex mb-5">
<div class="w-16 rounded-full bg-gray-100 py-2 px-4 mr-2">
<div class="p-1 rounded-full bg-gray-300"></div>
</div>
<div class="w-16 rounded-full bg-gray-100 py-2 px-4 mr-2">
<div class="p-1 rounded-full bg-gray-300"></div>
</div>
<div class="w-16 rounded-full bg-gray-100 py-2 px-4 mr-2">
<div class="p-1 rounded-full bg-gray-300"></div>
</div>
<div class="w-16 rounded-full bg-gray-100 py-2 px-4">
<div class="p-1 rounded-full bg-gray-300"></div>
</div>
</div>
<div class="flex flex-wrap -mx-4 mb-5">
<div class="w-1/3 px-4">
<div class="h-40 rounded-lg bg-white shadow-lg p-6">
<div
class="w-16 h-16 rounded-full bg-gray-200 mb-6"
></div>
<div
class="h-2 w-16 bg-gray-200 mb-2 rounded-full"
></div>
<div class="h-2 w-10 bg-gray-200 rounded-full"></div>
</div>
</div>
<div class="w-1/3 px-4">
<div class="h-40 rounded-lg bg-white shadow-lg p-6">
<div
class="w-16 h-16 rounded-full bg-gray-200 mb-6"
></div>
<div
class="h-2 w-16 bg-gray-200 mb-2 rounded-full"
></div>
<div class="h-2 w-10 bg-gray-200 rounded-full"></div>
</div>
</div>
<div class="w-1/3 px-4">
<div class="h-40 rounded-lg bg-white shadow-lg p-6">
<div
class="w-16 h-16 rounded-full bg-gray-200 mb-6"
></div>
<div
class="h-2 w-16 bg-gray-200 mb-2 rounded-full"
></div>
<div class="h-2 w-10 bg-gray-200 rounded-full"></div>
</div>
</div>
</div>
<h2 class="text-lg text-gray-700 font-bold mb-3">
Popular Payments
</h2>
<div
class="w-full flex flex-wrap justify-between items-center border-b-2 border-gray-100 py-3"
>
<div class="w-1/3">
<div class="flex">
<div class="h-8 w-8 rounded bg-gray-200 mr-4"></div>
<div>
<div
class="h-2 w-16 bg-gray-200 mb-1 rounded-full"
></div>
<div
class="h-2 w-10 bg-gray-100 rounded-full"
></div>
</div>
</div>
</div>
<div class="w-1/3">
<div
class="w-16 rounded-full bg-green-100 py-2 px-4 mx-auto"
>
<div class="p-1 rounded-full bg-green-200"></div>
</div>
</div>
<div class="w-1/3">
<div
class="h-2 w-10 bg-gray-100 rounded-full mx-auto"
></div>
</div>
</div>
<div
class="flex flex-wrap justify-between items-center border-b-2 border-gray-100 py-3"
>
<div class="w-1/3">
<div class="flex">
<div class="h-8 w-8 rounded bg-gray-200 mr-4"></div>
<div>
<div
class="h-2 w-16 bg-gray-200 mb-1 rounded-full"
></div>
<div
class="h-2 w-10 bg-gray-100 rounded-full"
></div>
</div>
</div>
</div>
<div class="w-1/3">
<div
class="w-16 rounded-full bg-orange-100 py-2 px-4 mx-auto"
>
<div class="p-1 rounded-full bg-orange-200"></div>
</div>
</div>
<div class="w-1/3">
<div
class="h-2 w-16 bg-gray-100 rounded-full mx-auto"
></div>
</div>
</div>
<div
class="flex flex-wrap justify-between items-center border-b-2 border-gray-100 py-3"
>
<div class="w-1/3">
<div class="flex">
<div class="h-8 w-8 rounded bg-gray-200 mr-4"></div>
<div>
<div
class="h-2 w-16 bg-gray-200 mb-1 rounded-full"
></div>
<div
class="h-2 w-10 bg-gray-100 rounded-full"
></div>
</div>
</div>
</div>
<div class="w-1/3">
<div
class="w-16 rounded-full bg-blue-100 py-2 px-4 mx-auto"
>
<div class="p-1 rounded-full bg-blue-200"></div>
</div>
</div>
<div class="w-1/3">
<div
class="h-2 w-8 bg-gray-100 rounded-full mx-auto"
></div>
</div>
</div>
</div>
</div>
<div
class="w-full absolute left-0 bottom-0 ml-1"
style="transform: rotate(-8deg); z-index: 1; margin-bottom: -360px;"
>
<div class="grid--gray h-48 w-48"></div>
</div>
</div>
<div
class="md:hidden w-full absolute right-0 top-0 flex rounded-lg bg-white overflow-hidden shadow"
>
<div
class="h-4 bg-gray-200 absolute top-0 left-0 right-0 rounded-t-lg flex items-center"
>
<span
class="h-2 w-2 rounded-full bg-red-500 inline-block mr-1 ml-2"
></span>
<span
class="h-2 w-2 rounded-full bg-orange-400 inline-block mr-1"
></span>
<span
class="h-2 w-2 rounded-full bg-green-500 inline-block mr-1"
></span>
</div>
<div class="w-32 bg-gray-100 px-2 py-8" style="height: 340px;">
<div class="h-2 w-16 bg-gray-300 rounded-full mb-4"></div>
<div class="flex items-center mb-4">
<div
class="h-5 w-5 rounded-full bg-gray-300 mr-3 flex-shrink-0"
></div>
<div>
<div class="h-2 w-10 bg-gray-300 rounded-full"></div>
</div>
</div>
<div class="h-2 w-16 bg-gray-200 rounded-full mb-2"></div>
<div class="h-2 w-10 bg-gray-200 rounded-full mb-2"></div>
<div class="h-2 w-20 bg-gray-200 rounded-full mb-2"></div>
<div class="h-2 w-6 bg-gray-200 rounded-full mb-2"></div>
<div class="h-2 w-16 bg-gray-200 rounded-full mb-2"></div>
<div class="h-2 w-10 bg-gray-200 rounded-full mb-2"></div>
<div class="h-2 w-20 bg-gray-200 rounded-full mb-2"></div>
<div class="h-2 w-6 bg-gray-200 rounded-full mb-2"></div>
</div>
<div class="flex-1 px-4 py-8">
<h2 class="text-xs text-gray-700 font-bold mb-1">
Popular Payments
</h2>
<div class="flex mb-5">
<div class="p-2 w-12 rounded-full bg-gray-100 mr-2"></div>
<div class="p-2 w-12 rounded-full bg-gray-100 mr-2"></div>
<div class="p-2 w-12 rounded-full bg-gray-100 mr-2"></div>
<div class="p-2 w-12 rounded-full bg-gray-100 mr-2"></div>
</div>
<div class="flex flex-wrap -mx-2 mb-5">
<div class="w-1/3 px-2">
<div class="p-3 rounded-lg bg-white shadow">
<div
class="w-6 h-6 rounded-full bg-gray-200 mb-2"
></div>
<div
class="h-2 w-10 bg-gray-200 mb-1 rounded-full"
></div>
<div class="h-2 w-6 bg-gray-200 rounded-full"></div>
</div>
</div>
<div class="w-1/3 px-2">
<div class="p-3 rounded-lg bg-white shadow">
<div
class="w-6 h-6 rounded-full bg-gray-200 mb-2"
></div>
<div
class="h-2 w-10 bg-gray-200 mb-1 rounded-full"
></div>
<div class="h-2 w-6 bg-gray-200 rounded-full"></div>
</div>
</div>
<div class="w-1/3 px-2">
<div class="p-3 rounded-lg bg-white shadow">
<div
class="w-6 h-6 rounded-full bg-gray-200 mb-2"
></div>
<div
class="h-2 w-10 bg-gray-200 mb-1 rounded-full"
></div>
<div class="h-2 w-6 bg-gray-200 rounded-full"></div>
</div>
</div>
</div>
<h2 class="text-xs text-gray-700 font-bold mb-1">
Popular Payments
</h2>
<div
class="w-full flex flex-wrap justify-between items-center border-b-2 border-gray-100 py-3"
>
<div class="w-1/3">
<div class="flex">
<div
class="h-5 w-5 rounded-full bg-gray-200 mr-3 flex-shrink-0"
></div>
<div>
<div
class="h-2 w-16 bg-gray-200 mb-1 rounded-full"
></div>
<div class="h-2 w-10 bg-gray-100 rounded-full"></div>
</div>
</div>
</div>
<div class="w-1/3">
<div
class="w-16 rounded-full bg-green-100 py-2 px-4 mx-auto"
>
<div class="p-1 rounded-full bg-green-200"></div>
</div>
</div>
<div class="w-1/3">
<div
class="h-2 w-10 bg-gray-100 rounded-full mx-auto"
></div>
</div>
</div>
<div class="flex flex-wrap justify-between items-center py-3">
<div class="w-1/3">
<div class="flex">
<div
class="h-5 w-5 rounded-full bg-gray-200 mr-3 flex-shrink-0"
></div>
<div>
<div
class="h-2 w-16 bg-gray-200 mb-1 rounded-full"
></div>
<div class="h-2 w-10 bg-gray-100 rounded-full"></div>
</div>
</div>
</div>
<div class="w-1/3">
<div
class="w-16 rounded-full bg-orange-100 py-2 px-4 mx-auto"
>
<div class="p-1 rounded-full bg-orange-200"></div>
</div>
</div>
<div class="w-1/3">
<div
class="h-2 w-16 bg-gray-100 rounded-full mx-auto"
></div>
</div>
</div>
</div>
</div>
<div
class="mr-3 md:hidden absolute right-0 bottom-0 w-40 bg-white rounded-lg shadow-lg px-10 py-6"
style="z-index: 2; margin-bottom: -380px;"
>
<div
class="bg-indigo-800 mx-auto rounded-lg w-20 pt-3 mb-12 relative"
>
<div class="h-3 bg-white"></div>
<div class="text-right my-2">
<div
class="inline-flex w-3 h-3 rounded-full bg-white -mr-2"
></div>
<div
class="inline-flex w-3 h-3 rounded-full bg-indigo-800 border-2 border-white mr-2"
></div>
</div>
<div
class="-ml-4 -mb-6 absolute left-0 bottom-0 w-16 bg-green-700 mx-auto rounded-lg pb-2 pt-3"
>
<div class="h-2 bg-white mb-2"></div>
<div class="h-2 bg-white w-6 ml-auto rounded mr-2"></div>
</div>
</div>
<div class="text-gray-800 text-center text-sm">
Payment for <br />Internet
</div>
</div>
</div>
</div>
</div>
</div>
<svg
class="fill-current text-white hidden md:block"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 1440 320"
>
<path fill-opacity="1" d="M0,224L1440,32L1440,320L0,320Z"></path>
</svg>
</div>
<p class="text-center p-4 text-gray-600 pt-10">
Created by
<a
class="border-b text-blue-500"
href="https://twitter.com/mithicher"
target="_blank"
>@mithicher</a
>. Inspired by dribble shot
<a
href="https://dribbble.com/shots/8807920-Quickpay-Hero-section/attachments/1015863"
target="_blank"
class="border-b text-blue-500"
>https://dribbble.com/vadimdrut</a
>
</p>
</div>
How to make a Landing Page with Tailwind CSS 2 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 make a Landing Page with Tailwind CSS 2 component
bg-indigo-900
px-4
py-4
md:max-w-6xl
md:mx-auto
md:flex
flex
inline-block
py-2
text-white
text-xl
md:hidden
bg-gray-400
w-8
mb-2
hidden
md:block
py-1
md:py-4
text-gray-100
mr-6
text-gray-500
hover:text-gray-100
text-gray-700
bg-white
hover:bg-gray-100
md:overflow-hidden
py-20
md:flex-wrap
md:w-1/2
text-center
md:text-left
md:pt-16
text-2xl
md:text-5xl
mb-4
text-indigo-200
md:text-xl
md:pr-48
mt-6
mb-12
md:mb-0
md:mt-10
py-3
px-8
bg-red-500
hover:bg-red-600
relative
-ml-24
-mb-40
absolute
left-0
bottom-0
w-40
px-6
py-8
bg-indigo-800
mx-auto
px-2
pb-2
mb-8
mb-1
w-1
h-1
bg-indigo-100
w-12
w-10
w-6
h-3
mr-1
-mr-2
-mb-4
right-0
h-16
bg-green-700
border-2
border-white
w-2
h-2
bg-green-800
mr-2
-mb-2
z-10
text-gray-800
ml-24
mb-16
w-20
h-8
top-0
-mt-3
ml-4
ml-8
h-6
ml-auto
border-4
-mr-1
-ml-3
-mb-5
ml-32
w-48
px-10
pt-4
h-4
text-right
my-2
pb-1
inline-flex
w-3
-ml-4
-mb-6
w-16
pt-3
mt-10
w-full
overflow-hidden
w-32
bg-gray-200
flex-1
p-6
text-lg
mb-3
mb-5
bg-gray-100
p-1
bg-gray-300
flex-wrap
-mx-4
w-1/3
h-40
mb-6
border-b-2
border-gray-100
mr-4
bg-green-100
bg-green-200
bg-orange-100
bg-orange-200
bg-blue-100
bg-blue-200
ml-1
grid--gray
h-48
ml-2
bg-orange-400
bg-green-500
h-5
w-5
mr-3
flex-shrink-0
text-xs
p-2
-mx-2
p-3
py-6
text-sm
p-4
text-gray-600
pt-10
border-b
text-blue-500
160 steps to make a Landing Page with Tailwind CSS 2 component with Tailwind CSS
Control the background color of an element to indigo-900 using the
bg-indigo-900
utilities.Control the horizontal padding of an element to 1rem using the
px-4
utilities.Control the vertical padding of an element to 1rem using the
py-4
utilities.Set the maximum width/height of an element using the
md:max-w-6xl
utilities at only medium screen sizes.Control the horizontal margin of an element to auto at only medium screen sizes using the
md:mx-auto
utilities.Use
flex
to create a block-level flex container at only medium screen sizes.Use
flex
to create a block-level flex container.Use
inline-block
utilities to wrap the element to prevent the text inside from extending beyond its parent.Control the vertical padding of an element to 0.5rem using the
py-2
utilities.Control the text color of an element to white using the
text-white
utilities.Control the text color of an element to xl using the
text-xl
utilities.Use
hidden
to set an element to display: none and remove it from the page layout at only medium screen sizes.Control the background color of an element to gray-400 using the
bg-gray-400
utilities.Use
w-8
to set an element to a fixed width(2rem).Control the margin on bottom side of an element to 0.5rem using the
mb-2
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 medium screen sizes.Control the vertical padding of an element to 0.25rem using the
py-1
utilities.Control the vertical padding of an element to 1rem at only medium screen sizes using the
md:py-4
utilities.Control the text color of an element to gray-100 using the
text-gray-100
utilities.Control the margin on right side of an element to 1.5rem using the
mr-6
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 gray-100 on hover using the
hover:text-gray-100
utilities.Control the text color of an element to gray-700 using the
text-gray-700
utilities.Control the background color of an element to white using the
bg-white
utilities.Control the background color of an element to gray-100 using the
hover:bg-gray-100
utilities on hover.Use
overflow-hidden
to clip any content within an element that overflows the bounds of that element at only medium screen sizes.Control the vertical padding of an element to 5rem using the
py-20
utilities.Use
flex
to create a block-level flex container at only medium screen sizes.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 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 padding on top side of an element to 4rem at only medium screen sizes using the
md:pt-16
utilities.Control the text color of an element to 2xl using the
text-2xl
utilities.Control the text color of an element to 5xl at only medium screen sizes using the
md:text-5xl
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 indigo-200 using the
text-indigo-200
utilities.Control the text color of an element to xl at only medium screen sizes using the
md:text-xl
utilities.Control the padding on right side of an element to 12rem at only medium screen sizes using the
md:pr-48
utilities.Control the margin on top side of an element to 1.5rem using the
mt-6
utilities.Control the margin on bottom side of an element to 3rem using the
mb-12
utilities.Control the margin on bottom side of an element to 0rem at only medium screen sizes using the
md:mb-0
utilities.Control the margin on top side of an element to 2.5rem at only medium screen sizes using the
md:mt-10
utilities.Control the vertical padding of an element to 0.75rem using the
py-3
utilities.Control the horizontal padding of an element to 2rem using the
px-8
utilities.Control the background color of an element to red-500 using the
bg-red-500
utilities.Control the background color of an element to red-600 using the
hover:bg-red-600
utilities on hover.Use
relative
to position an element according to the normal flow of the document.Control the margin on left side of an element to -6rem using the
-ml-24
utilities.Control the margin on bottom side of an element to -10rem using the
-mb-40
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
left-0
utilities to set the left position of a positioned element to 0rem.Use the
bottom-0
utilities to set the bottom position of a positioned element to 0rem.Use
w-40
to set an element to a fixed width(10rem).Control the horizontal padding of an element to 1.5rem using the
px-6
utilities.Control the vertical padding of an element to 2rem using the
py-8
utilities.Control the background color of an element to indigo-800 using the
bg-indigo-800
utilities.Control the horizontal margin of an element to auto using the
mx-auto
utilities.Control the horizontal padding of an element to 0.5rem using the
px-2
utilities.Control the padding on bottom side of an element to 0.5rem using the
pb-2
utilities.Control the margin on bottom side of an element to 2rem using the
mb-8
utilities.Control the margin on bottom side of an element to 0.25rem using the
mb-1
utilities.Use
w-1
to set an element to a fixed width(0.25rem).Use
h-1
to set an element to a fixed height(0.25rem).Control the background color of an element to indigo-100 using the
bg-indigo-100
utilities.Use
w-12
to set an element to a fixed width(3rem).Use
w-10
to set an element to a fixed width(2.5rem).Use
w-6
to set an element to a fixed width(1.5rem).Use
h-3
to set an element to a fixed height(0.75rem).Control the margin on right side of an element to 0.25rem using the
mr-1
utilities.Control the margin on right side of an element to -0.5rem using the
-mr-2
utilities.Control the margin on bottom side of an element to -1rem using the
-mb-4
utilities.Use the
right-0
utilities to set the right position of a positioned element to 0rem.Use
h-16
to set an element to a fixed height(4rem).Control the background color of an element to green-700 using the
bg-green-700
utilities.Control the border color of an element to 0.5rem using the
border-2
utilities.Control the border color of an element to white using the
border-white
utilities.Use
w-2
to set an element to a fixed width(0.5rem).Use
h-2
to set an element to a fixed height(0.5rem).Control the background color of an element to green-800 using the
bg-green-800
utilities.Control the margin on right side of an element to 0.5rem using the
mr-2
utilities.Control the margin on bottom side of an element to -0.5rem using the
-mb-2
utilities.Control the stack order (or three-dimensional positioning) of an element to 10 in Tailwind, regardless of order it has been displayed, using the
z-10
utilities.Control the text color of an element to gray-800 using the
text-gray-800
utilities.Control the margin on left side of an element to 6rem using the
ml-24
utilities.Control the margin on bottom side of an element to 4rem using the
mb-16
utilities.Use
w-20
to set an element to a fixed width(5rem).Use
h-8
to set an element to a fixed height(2rem).Use the
top-0
utilities to set the top position of a positioned element to 0rem.Control the margin on top side of an element to -0.75rem using the
-mt-3
utilities.Control the margin on left side of an element to 1rem using the
ml-4
utilities.Control the margin on left side of an element to 2rem using the
ml-8
utilities.Use
h-6
to set an element to a fixed height(1.5rem).Control the margin on left side of an element to auto using the
ml-auto
utilities.Control the border color of an element to 1rem using the
border-4
utilities.Control the margin on right side of an element to -0.25rem using the
-mr-1
utilities.Control the margin on left side of an element to -0.75rem using the
-ml-3
utilities.Control the margin on bottom side of an element to -1.25rem using the
-mb-5
utilities.Control the margin on left side of an element to 8rem using the
ml-32
utilities.Use
w-48
to set an element to a fixed width(12rem).Control the horizontal padding of an element to 2.5rem using the
px-10
utilities.Control the padding on top side of an element to 1rem using the
pt-4
utilities.Use
h-4
to set an element to a fixed height(1rem).Control the text color of an element to right using the
text-right
utilities.Control the vertical margin of an element to 0.5rem using the
my-2
utilities.Control the padding on bottom side of an element to 0.25rem using the
pb-1
utilities.Use
inline-flex
to create an inline flex container that flows with text.Use
w-3
to set an element to a fixed width(0.75rem).Control the margin on left side of an element to -1rem using the
-ml-4
utilities.Control the margin on bottom side of an element to -1.5rem using the
-mb-6
utilities.Use
w-16
to set an element to a fixed width(4rem).Control the padding on top side of an element to 0.75rem using the
pt-3
utilities.Control the margin on top side of an element to 2.5rem using the
mt-10
utilities.Use
w-full
to set an element to a 100% based width.Use
overflow-hidden
to clip any content within an element that overflows the bounds of that element.Use
w-32
to set an element to a fixed width(8rem).Control the background color of an element to gray-200 using the
bg-gray-200
utilities.Use
flex
to create a block-level flex container.Control the padding on all sides of an element to 1.5rem using the
p-6
utilities.Control the text color of an element to lg using the
text-lg
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 1.25rem using the
mb-5
utilities.Control the background color of an element to gray-100 using the
bg-gray-100
utilities.Control the padding on all sides of an element to 0.25rem using the
p-1
utilities.Control the background color of an element to gray-300 using the
bg-gray-300
utilities.Use
flex
to create a block-level flex container.Control the horizontal margin of an element to -1rem using the
-mx-4
utilities.Use
w-1/3
to set an element to a fixed width(1/3).Use
h-40
to set an element to a fixed height(10rem).Control the margin on bottom side of an element to 1.5rem using the
mb-6
utilities.Control the border color of an element to b-2 using the
border-b-2
utilities.Control the border color of an element to gray-100 using the
border-gray-100
utilities.Control the margin on right side of an element to 1rem using the
mr-4
utilities.Control the background color of an element to green-100 using the
bg-green-100
utilities.Control the background color of an element to green-200 using the
bg-green-200
utilities.Control the background color of an element to orange-100 using the
bg-orange-100
utilities.Control the background color of an element to orange-200 using the
bg-orange-200
utilities.Control the background color of an element to blue-100 using the
bg-blue-100
utilities.Control the background color of an element to blue-200 using the
bg-blue-200
utilities.Control the margin on left side of an element to 0.25rem using the
ml-1
utilities.Use
grid
to create a grid container.Use
h-48
to set an element to a fixed height(12rem).Control the margin on left side of an element to 0.5rem using the
ml-2
utilities.Control the background color of an element to orange-400 using the
bg-orange-400
utilities.Control the background color of an element to green-500 using the
bg-green-500
utilities.Use
h-5
to set an element to a fixed height(1.25rem).Use
w-5
to set an element to a fixed width(1.25rem).Control the margin on right side of an element to 0.75rem using the
mr-3
utilities.Use
flex
to create a block-level flex container.Control the text color of an element to xs using the
text-xs
utilities.Control the padding on all sides of an element to 0.5rem using the
p-2
utilities.Control the horizontal margin of an element to -0.5rem using the
-mx-2
utilities.Control the padding on all sides of an element to 0.75rem using the
p-3
utilities.Control the vertical padding of an element to 1.5rem using the
py-6
utilities.Control the text color of an element to sm using the
text-sm
utilities.Control the padding on all sides of an element to 1rem using the
p-4
utilities.Control the text color of an element to gray-600 using the
text-gray-600
utilities.Control the padding on top side of an element to 2.5rem using the
pt-10
utilities.Control the border color of an element to b using the
border-b
utilities.Control the text color of an element to blue-500 using the
text-blue-500
utilities.
Conclusion
The above is a step-by-step tutorial on how to use Tailwind CSS to make a Landing Page with Tailwind CSS 2 components, learn and follow along to implement your own components.