- Published on
6 Steps To Build A Tin Tức With Tailwind CSS Like A Pro In Under An Hour

- What is Tailwind CSS?
- The description of Tin Tức ui component
- Why use Tailwind CSS to create a Tin Tức ui component?
- The preview of Tin Tức ui component
- The source code of Tin Tức ui component
- How to create a Tin Tức with Tailwind CSS?
- Install tailwind css of verion 2.1.0
- All the unility class needed to create a Tin Tức component
- 69 steps to create a Tin Tức 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 Tin Tức ui component
Tin tức nguồn chưa rõ
Why use Tailwind CSS to create a Tin Tức ui component?
- It can make the building process of Tin Tức ui component faster and more easily.
- Enables building complex responsive layouts and components freely.
- Minimum lines of CSS code in Tin Tức component file.
The preview of Tin Tức ui component
Free download of the Tin Tức's source code
The source code of Tin Tức ui component
<div class="min-w-screen min-h-screen bg-gray-200 flex items-center justify-center px-5 py-5">
<div class="bg-white text-gray-800 rounded-xl shadow-lg overflow-hidden relative flex" style="width:414px;height:736px">
<div class="bg-white h-full w-full px-5 pt-6 pb-20 overflow-y-auto">
<div class="mb-3">
<h1 class="text-3xl font-bold">Today</h1>
<p class="text-sm text-gray-500 uppercase font-bold">THURSDAY 6 AUGUST</p>
</div>
<div class="mb-5">
<a href="#" class="block rounded-lg relative p-5 transform transition-all duration-300 scale-100 hover:scale-95" style="background: url(https://images.unsplash.com/photo-1484876065684-b683cf17d276?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=668&q=80) center; background-size: cover;">
<div class="absolute top-0 right-0 -mt-3 mr-3">
<div class="rounded-full bg-indigo-500 text-white text-xs py-1 pl-2 pr-3 leading-none"><i class="mdi mdi-fire text-base align-middle"></i> <span class="align-middle">FRESH</span></div>
</div>
<div class="h-48"></div>
<h2 class="text-white text-2xl font-bold leading-tight mb-3 pr-5">Tasnim Lacey New Album Out Now</h2>
<div class="flex w-full items-center text-sm text-gray-300 font-medium">
<div class="flex-1 flex items-center">
<div class="rounded-full w-8 h-8 mr-3" style="background: url(https://randomuser.me/api/portraits/women/74.jpg) center; background-size: cover;"></div>
<div>Gwen Thomson</div>
</div>
<div><i class="mdi mdi-thumb-up"></i> 18</div>
</div>
</a>
</div>
<div class="mb-5">
<a href="#" class="block rounded-lg relative p-5 transform transition-all duration-300 scale-100 hover:scale-95" style="background: url(https://images.unsplash.com/photo-1470337458703-46ad1756a187?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1649&q=80) center; background-size: cover;">
<div class="h-48"></div>
<h2 class="text-white text-2xl font-bold leading-tight mb-3 pr-5">Top 5 Cocktail Bars in NYC</h2>
<div class="flex w-full items-center text-sm text-gray-300 font-medium">
<div class="flex-1 flex items-center">
<div class="rounded-full w-8 h-8 mr-3" style="background: url(https://randomuser.me/api/portraits/women/55.jpg) center; background-size: cover;"></div>
<div>Kayden Buckley</div>
</div>
<div><i class="mdi mdi-thumb-up"></i> 7</div>
</div>
</a>
</div>
<div class="mb-3">
<h1 class="text-3xl font-bold">Yesterday</h1>
<p class="text-sm text-gray-500 uppercase font-bold">WEDNESDAY 5 AUGUST</p>
</div>
<div class="flex -mx-1 mb-5">
<div class="w-1/2 px-1">
<a href="#" class="block mb-2 p-5 rounded overflow-hidden transform transition-all duration-300 scale-100 hover:scale-95" style="background: url(https://images.unsplash.com/photo-1470225620780-dba8ba36b745?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=800&q=60) center; background-size: cover;">
<div class="h-24"></div>
<h3 class="text-lg font-bold text-white leading-tight">DJ Dan Spins The Wheels</h3>
</a>
<a href="#" class="block mb-2 p-5 rounded overflow-hidden transform transition-all duration-300 scale-100 hover:scale-95" style="background: url(https://images.unsplash.com/photo-1534329539061-64caeb388c42?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=800&q=60) center; background-size: cover;">
<div class="h-32"></div>
<h3 class="text-lg font-bold text-white leading-tight">Top Travels Destinations For 2020</h3>
</a>
</div>
<div class="w-1/2 px-1">
<a href="#" class="block mb-2 p-5 rounded overflow-hidden transform transition-all duration-300 scale-100 hover:scale-95" style="background: url(https://images.unsplash.com/photo-1526661934280-676cef25bc9b?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=800&q=60) center; background-size: cover;">
<div class="h-32"></div>
<h3 class="text-lg font-bold text-white leading-tight">M&S Launches New Makeup Range!</h3>
</a>
<a href="#" class="block mb-2 p-5 rounded overflow-hidden transform transition-all duration-300 scale-100 hover:scale-95" style="background: url(https://images.unsplash.com/photo-1558365849-6ebd8b0454b2?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=800&q=60) center; background-size: cover;">
<div class="h-24"></div>
<h3 class="text-lg font-bold text-white leading-tight">APT Set To Be A Ripper</h3>
</a>
</div>
</div>
<div class="mb-3">
<h1 class="text-3xl font-bold">Previous</h1>
</div>
<div>
<a href="#" class="flex w-full transform transition-all duration-300 scale-100 hover:scale-95">
<div class="block h-24 w-2/5 rounded overflow-hidden" style="background: url(https://images.unsplash.com/photo-1530549387789-4c1017266635?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=800&q=60) center; background-size: cover;"></div>
<div class="pl-3 w-3/5">
<p class="text-xs text-gray-500 uppercase font-semibold">SPORTS</p>
<h3 class="text-md font-semibold leading-tight mb-3">Lorem ipsum dolor sit amet consectetur adipisicing elit</h3>
<div class="flex w-full items-center text-xs text-gray-500 font-medium">
<div class="rounded-full w-5 h-5 mr-3" style="background: url(https://randomuser.me/api/portraits/men/41.jpg) center; background-size: cover;"></div>
<div>Jack Ryan</div>
</div>
</div>
</a>
</div>
<hr class="border-gray-200 my-3">
<div>
<a href="#" class="flex w-full transform transition-all duration-300 scale-100 hover:scale-95">
<div class="block h-24 w-2/5 rounded overflow-hidden" style="background: url(https://images.unsplash.com/photo-1499781350541-7783f6c6a0c8?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=800&q=60) center; background-size: cover;"></div>
<div class="pl-3 w-3/5">
<p class="text-xs text-gray-500 uppercase font-semibold">ART</p>
<h3 class="text-md font-semibold leading-tight mb-3">Lorem ipsum dolor sit amet consectetur adipisicing elit</h3>
<div class="flex w-full items-center text-xs text-gray-500 font-medium">
<div class="rounded-full w-5 h-5 mr-3" style="background: url(https://randomuser.me/api/portraits/men/63.jpg) center; background-size: cover;"></div>
<div>Kevin Jackson</div>
</div>
</div>
</a>
</div>
<hr class="border-gray-200 my-3">
<div>
<a href="#" class="flex w-full transform transition-all duration-300 scale-100 hover:scale-95">
<div class="block h-24 w-2/5 rounded overflow-hidden" style="background: url(https://images.unsplash.com/photo-1505740420928-5e560c06d30e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=800&q=60) center; background-size: cover;"></div>
<div class="pl-3 w-3/5">
<p class="text-xs text-gray-500 uppercase font-semibold">MUSIC</p>
<h3 class="text-md font-semibold leading-tight mb-3">Lorem ipsum dolor sit amet consectetur adipisicing elit</h3>
<div class="flex w-full items-center text-xs text-gray-500 font-medium">
<div class="rounded-full w-5 h-5 mr-3" style="background: url(https://randomuser.me/api/portraits/women/11.jpg) center; background-size: cover;"></div>
<div>Rowena Wheeler</div>
</div>
</div>
</a>
</div>
<hr class="border-gray-200 my-3">
<div>
<a href="#" class="flex w-full transform transition-all duration-300 scale-100 hover:scale-95">
<div class="block h-24 w-2/5 rounded overflow-hidden" style="background: url(https://images.unsplash.com/photo-1511068797325-6083f0f872b1?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=800&q=60) center; background-size: cover;"></div>
<div class="pl-3 w-3/5">
<p class="text-xs text-gray-500 uppercase font-semibold">WORLD</p>
<h3 class="text-md font-semibold leading-tight mb-3">Lorem ipsum dolor sit amet consectetur adipisicing elit</h3>
<div class="flex w-full items-center text-xs text-gray-500 font-medium">
<div class="rounded-full w-5 h-5 mr-3" style="background: url(https://randomuser.me/api/portraits/women/74.jpg) center; background-size: cover;"></div>
<div>Gwen Thomson</div>
</div>
</div>
</a>
</div>
</div>
<div class="bg-white absolute bottom-0 w-full border-t border-gray-200 flex">
<a href="#" class="flex flex-grow items-center justify-center p-2 text-indigo-500 hover:text-indigo-500">
<div class="text-center">
<span class="block h-8 text-3xl leading-8">
<i class="mdi mdi-newspaper-variant-outline"></i>
</span>
<span class="block text-xs leading-none">Today</span>
</div>
</a>
<a href="#" class="flex flex-grow items-center justify-center p-2 text-gray-500 hover:text-indigo-500">
<div class="text-center">
<span class="block h-8 text-3xl leading-8">
<i class="mdi mdi-apps"></i>
</span>
<span class="block text-xs leading-none">Categories</span>
</div>
</a>
<a href="#" class="flex flex-grow items-center justify-center p-2 text-gray-500 hover:text-indigo-500">
<div class="text-center">
<span class="block h-8 text-3xl leading-8">
<i class="mdi mdi-star-outline"></i>
</span>
<span class="block text-xs leading-none">Favorites</span>
</div>
</a>
<a href="#" class="flex flex-grow items-center justify-center p-2 text-gray-500 hover:text-indigo-500">
<div class="text-center">
<span class="block h-8 text-3xl leading-8">
<i class="mdi mdi-magnify"></i>
</span>
<span class="block text-xs leading-none">Search</span>
</div>
</a>
</div>
</div>
</div>
<!-- BUY ME A BEER AND HELP SUPPORT OPEN-SOURCE RESOURCES -->
<div class="flex items-end justify-end fixed bottom-0 right-0 mb-4 mr-4 z-10">
<div>
<a title="Buy me a beer" href="https://www.buymeacoffee.com/scottwindon" target="_blank" class="block w-16 h-16 rounded-full transition-all shadow hover:shadow-lg transform hover:scale-110 hover:rotate-12">
<img class="object-cover object-center w-full h-full rounded-full" src="https://i.pinimg.com/originals/60/fd/e8/60fde811b6be57094e0abc69d9c2622a.jpg"/>
</a>
</div>
</div>
How to create a Tin Tức with Tailwind CSS?
Install tailwind css of verion 2.1.0
Use the script
html tag to import the script of Tailwind CSS of the version 2.1.0
<script src="https://cdn.tailwindcss.com"></script>
All the unility class needed to create a Tin Tức component
min-w-screen
min-h-screen
bg-gray-200
flex
px-5
py-5
bg-white
text-gray-800
overflow-hidden
relative
h-full
w-full
pt-6
pb-20
overflow-y-auto
mb-3
text-3xl
text-sm
text-gray-500
mb-5
block
p-5
absolute
top-0
right-0
-mt-3
mr-3
bg-indigo-500
text-white
text-xs
py-1
pl-2
pr-3
text-base
h-48
text-2xl
pr-5
text-gray-300
flex-1
w-8
h-8
-mx-1
w-1/2
px-1
mb-2
h-24
text-lg
h-32
w-2/5
pl-3
w-3/5
text-md
w-5
h-5
border-gray-200
my-3
bottom-0
border-t
flex-grow
p-2
text-indigo-500
hover:text-indigo-500
text-center
fixed
mb-4
mr-4
z-10
w-16
h-16
69 steps to create a Tin Tức component with Tailwind CSS
Set the minimum width/height of an element using the
min-w-screen
utilities.Set the minimum width/height of an element using the
min-h-screen
utilities.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 horizontal padding of an element to 1.25rem using the
px-5
utilities.Control the vertical padding of an element to 1.25rem using the
py-5
utilities.Control the background color of an element to white using the
bg-white
utilities.Control the text color of an element to gray-800 using the
text-gray-800
utilities.Use
overflow-hidden
to clip any content within an element that overflows the bounds of that element.Use
relative
to position an element according to the normal flow of the document.Use
h-full
to set an element’s height to 100% of its parent, as long as the parent has a defined height.Use
w-full
to set an element to a 100% based width.Control the padding on top side of an element to 1.5rem using the
pt-6
utilities.Control the padding on bottom side of an element to 5rem using the
pb-20
utilities.Use
overflow-y-auto
to allow vertical scrolling if needed.Control the margin on bottom side of an element to 0.75rem using the
mb-3
utilities.Control the text color of an element to 3xl using the
text-3xl
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.Control the margin on bottom side of an element to 1.25rem using the
mb-5
utilities.Use
inline
utilities to put the element on its own line and fill its parent.Control the padding on all sides of an element to 1.25rem using the
p-5
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
top-0
utilities to set the top position of a positioned element to 0rem.Use the
right-0
utilities to set the right 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 right side of an element to 0.75rem using the
mr-3
utilities.Control the background color of an element to indigo-500 using the
bg-indigo-500
utilities.Control the text color of an element to white using the
text-white
utilities.Control the text color of an element to xs using the
text-xs
utilities.Control the vertical padding of an element to 0.25rem using the
py-1
utilities.Set the left padding of the element to 0.5rem using the
pl-2
utilities classControl the padding on right side of an element to 0.75rem using the
pr-3
utilities.Control the text color of an element to base using the
text-base
utilities.Use
h-48
to set an element to a fixed height(12rem).Control the text color of an element to 2xl using the
text-2xl
utilities.Control the padding on right side of an element to 1.25rem using the
pr-5
utilities.Control the text color of an element to gray-300 using the
text-gray-300
utilities.Use
flex
to create a block-level flex container.Use
w-8
to set an element to a fixed width(2rem).Use
h-8
to set an element to a fixed height(2rem).Control the horizontal margin of an element to -0.25rem using the
-mx-1
utilities.Use
w-1/2
to set an element to a fixed width(1/2).Control the horizontal padding of an element to 0.25rem using the
px-1
utilities.Control the margin on bottom side of an element to 0.5rem using the
mb-2
utilities.Use
h-24
to set an element to a fixed height(6rem).Control the text color of an element to lg using the
text-lg
utilities.Use
h-32
to set an element to a fixed height(8rem).Use
w-2/5
to set an element to a fixed width(2/5).Set the left padding of the element to 0.75rem using the
pl-3
utilities classUse
w-3/5
to set an element to a fixed width(3/5).Control the text color of an element to md using the
text-md
utilities.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).Control the border color of an element to gray-200 using the
border-gray-200
utilities.Control the vertical margin of an element to 0.75rem using the
my-3
utilities.Use the
bottom-0
utilities to set the bottom position of a positioned element to 0rem.Control the border color of an element to t using the
border-t
utilities.Use
flex
to create a block-level flex container.Control the padding on all sides of an element to 0.5rem using the
p-2
utilities.Control the text color of an element to indigo-500 using the
text-indigo-500
utilities.Control the text color of an element to indigo-500 on hover using the
hover:text-indigo-500
utilities.Control the text color of an element to center using the
text-center
utilities.Use
fixed
to position an element relative to the browser window.Control the margin on bottom side of an element to 1rem using the
mb-4
utilities.Control the margin on right side of an element to 1rem using the
mr-4
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.Use
w-16
to set an element to a fixed width(4rem).Use
h-16
to set an element to a fixed height(4rem).
Conclusion
The above is a step-by-step tutorial on how to use Tailwind CSS to create a Tin Tức components, learn and follow along to implement your own components.