- Published on
Most Effective Ways To Build A Profile Page With Tailwind CSS

- What is Tailwind CSS?
- The description of Profile Page ui component
- Why use Tailwind CSS to build a Profile Page ui component?
- The preview of Profile Page ui component
- The source code of Profile Page ui component
- How to build a Profile Page with Tailwind CSS?
- Install tailwind css of verion 2.2.4
- All the unility class needed to build a Profile Page component
- 81 steps to build a Profile Page 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 Profile Page ui component
Profile page with ackground image
Why use Tailwind CSS to build a Profile Page ui component?
- It can make the building process of Profile Page ui component faster and more easily.
- Enables building complex responsive layouts and components freely.
- Minimum lines of CSS code in Profile Page component file.
The preview of Profile Page ui component
Free download of the Profile Page's source code
The source code of Profile Page ui component
<link rel="stylesheet" href="https://demos.creative-tim.com/notus-js/assets/styles/tailwind.css">
<link rel="stylesheet" href="https://demos.creative-tim.com/notus-js/assets/vendor/@fortawesome/fontawesome-free/css/all.min.css">
<main class="profile-page">
<section class="relative block h-500-px">
<div class="absolute top-0 w-full h-full bg-center bg-cover" style="
background-image: url('https://images.unsplash.com/photo-1499336315816-097655dcfbda?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2710&q=80');
">
<span id="blackOverlay" class="w-full h-full absolute opacity-50 bg-black"></span>
</div>
<div class="top-auto bottom-0 left-0 right-0 w-full absolute pointer-events-none overflow-hidden h-70-px" style="transform: translateZ(0px)">
<svg class="absolute bottom-0 overflow-hidden" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none" version="1.1" viewBox="0 0 2560 100" x="0" y="0">
<polygon class="text-blueGray-200 fill-current" points="2560 0 2560 100 0 100"></polygon>
</svg>
</div>
</section>
<section class="relative py-16 bg-blueGray-200">
<div class="container mx-auto px-4">
<div class="relative flex flex-col min-w-0 break-words bg-white w-full mb-6 shadow-xl rounded-lg -mt-64">
<div class="px-6">
<div class="flex flex-wrap justify-center">
<div class="w-full lg:w-3/12 px-4 lg:order-2 flex justify-center">
<div class="relative">
<img alt="..." src="https://demos.creative-tim.com/notus-js/assets/img/team-2-800x800.jpg" class="shadow-xl rounded-full h-auto align-middle border-none absolute -m-16 -ml-20 lg:-ml-16 max-w-150-px">
</div>
</div>
<div class="w-full lg:w-4/12 px-4 lg:order-3 lg:text-right lg:self-center">
<div class="py-6 px-3 mt-32 sm:mt-0">
<button class="bg-pink-500 active:bg-pink-600 uppercase text-white font-bold hover:shadow-md shadow text-xs px-4 py-2 rounded outline-none focus:outline-none sm:mr-2 mb-1 ease-linear transition-all duration-150" type="button">
Connect
</button>
</div>
</div>
<div class="w-full lg:w-4/12 px-4 lg:order-1">
<div class="flex justify-center py-4 lg:pt-4 pt-8">
<div class="mr-4 p-3 text-center">
<span class="text-xl font-bold block uppercase tracking-wide text-blueGray-600">22</span><span class="text-sm text-blueGray-400">Friends</span>
</div>
<div class="mr-4 p-3 text-center">
<span class="text-xl font-bold block uppercase tracking-wide text-blueGray-600">10</span><span class="text-sm text-blueGray-400">Photos</span>
</div>
<div class="lg:mr-4 p-3 text-center">
<span class="text-xl font-bold block uppercase tracking-wide text-blueGray-600">89</span><span class="text-sm text-blueGray-400">Comments</span>
</div>
</div>
</div>
</div>
<div class="text-center mt-12">
<h3 class="text-4xl font-semibold leading-normal mb-2 text-blueGray-700 mb-2">
Jenna Stones
</h3>
<div class="text-sm leading-normal mt-0 mb-2 text-blueGray-400 font-bold uppercase">
<i class="fas fa-map-marker-alt mr-2 text-lg text-blueGray-400"></i>
Los Angeles, California
</div>
<div class="mb-2 text-blueGray-600 mt-10">
<i class="fas fa-briefcase mr-2 text-lg text-blueGray-400"></i>Solution Manager - Creative Tim Officer
</div>
<div class="mb-2 text-blueGray-600">
<i class="fas fa-university mr-2 text-lg text-blueGray-400"></i>University of Computer Science
</div>
</div>
<div class="mt-10 py-10 border-t border-blueGray-200 text-center">
<div class="flex flex-wrap justify-center">
<div class="w-full lg:w-9/12 px-4">
<p class="mb-4 text-lg leading-relaxed text-blueGray-700">
An artist of considerable range, Jenna the name taken by
Melbourne-raised, Brooklyn-based Nick Murphy writes,
performs and records all of his own music, giving it a
warm, intimate feel with a solid groove structure. An
artist of considerable range.
</p>
<a href="#pablo" class="font-normal text-pink-500">Show more</a>
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="relative bg-blueGray-200 pt-8 pb-6 mt-8">
<div class="container mx-auto px-4">
<div class="flex flex-wrap items-center md:justify-between justify-center">
<div class="w-full md:w-6/12 px-4 mx-auto text-center">
<div class="text-sm text-blueGray-500 font-semibold py-1">
Made with <a href="https://www.creative-tim.com/product/notus-js" class="text-blueGray-500 hover:text-gray-800" target="_blank">Notus JS</a> by <a href="https://www.creative-tim.com" class="text-blueGray-500 hover:text-blueGray-800" target="_blank"> Creative Tim</a>.
</div>
</div>
</div>
</div>
</footer>
</section>
</main>
How to build a Profile Page 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 build a Profile Page component
relative
block
h-500-px
absolute
top-0
w-full
h-full
bg-center
bg-cover
bg-black
top-auto
bottom-0
left-0
right-0
overflow-hidden
h-70-px
text-blueGray-200
py-16
bg-blueGray-200
mx-auto
px-4
flex
flex-col
min-w-0
bg-white
mb-6
-mt-64
px-6
flex-wrap
lg:w-3/12
h-auto
border-none
-m-16
-ml-20
lg:-ml-16
max-w-150-px
lg:w-4/12
lg:text-right
py-6
px-3
mt-32
sm:mt-0
bg-pink-500
active:bg-pink-600
text-white
text-xs
py-2
sm:mr-2
mb-1
py-4
lg:pt-4
pt-8
mr-4
p-3
text-center
text-xl
text-blueGray-600
text-sm
text-blueGray-400
lg:mr-4
mt-12
text-4xl
mb-2
text-blueGray-700
mt-0
mr-2
text-lg
mt-10
py-10
border-t
border-blueGray-200
lg:w-9/12
mb-4
text-pink-500
pb-6
mt-8
md:w-6/12
text-blueGray-500
py-1
hover:text-gray-800
hover:text-blueGray-800
81 steps to build a Profile Page component with Tailwind CSS
Use
relative
to position an element according to the normal flow of the document.Use
inline
utilities to put the element on its own line and fill its parent.Use
h-500-px
to set an element to a fixed height(500-px).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
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.Control the background color of an element to center using the
bg-center
utilities.Control the background color of an element to cover using the
bg-cover
utilities.Control the background color of an element to black using the
bg-black
utilities.Use the
top-auto
utilities to set the top position of a positioned element to auto.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.Use the
right-0
utilities to set the right position of a positioned element to 0rem.Use
overflow-hidden
to clip any content within an element that overflows the bounds of that element.Use
h-70-px
to set an element to a fixed height(70-px).Control the text color of an element to blueGray-200 using the
text-blueGray-200
utilities.Control the vertical padding of an element to 4rem using the
py-16
utilities.Control the background color of an element to blueGray-200 using the
bg-blueGray-200
utilities.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.Use
flex
to create a block-level flex container.Use
flex
to create a block-level flex container.Set the minimum width/height of an element using the
min-w-0
utilities.Control the background color of an element to white using the
bg-white
utilities.Control the margin on bottom side of an element to 1.5rem using the
mb-6
utilities.Control the margin on top side of an element to -16rem using the
-mt-64
utilities.Control the horizontal padding of an element to 1.5rem using the
px-6
utilities.Use
flex
to create a block-level flex container.Use
lg:w-3/12
to set an element to a fixed width(3/12) at only large screen sizes.Use
h-auto
to set an element to a fixed height(auto).Control the border color of an element to none using the
border-none
utilities.Control the margin on all sides of an element to -4rem using the
-m-16
utilities.Control the margin on left side of an element to -5rem using the
-ml-20
utilities.Control the margin on left side of an element to -4rem at only large screen sizes using the
lg:-ml-16
utilities.Set the maximum width/height of an element using the
max-w-150-px
utilities.Use
lg:w-4/12
to set an element to a fixed width(4/12) at only large screen sizes.Control the text color of an element to right at only large screen sizes using the
lg:text-right
utilities.Control the vertical padding of an element to 1.5rem using the
py-6
utilities.Control the horizontal padding of an element to 0.75rem using the
px-3
utilities.Control the margin on top side of an element to 8rem using the
mt-32
utilities.Control the margin on top side of an element to 0rem at only small screen sizes using the
sm:mt-0
utilities.Control the background color of an element to pink-500 using the
bg-pink-500
utilities.Control the background color of an element to pink-600 using the
active:bg-pink-600
utilities on active.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.5rem using the
py-2
utilities.Control the margin on right side of an element to 0.5rem at only small screen sizes using the
sm:mr-2
utilities.Control the margin on bottom side of an element to 0.25rem using the
mb-1
utilities.Control the vertical padding of an element to 1rem using the
py-4
utilities.Control the padding on top side of an element to 1rem at only large screen sizes using the
lg:pt-4
utilities.Control the padding on top side of an element to 2rem using the
pt-8
utilities.Control the margin on right side of an element to 1rem using the
mr-4
utilities.Control the padding on all sides of an element to 0.75rem using the
p-3
utilities.Control the text color of an element to center using the
text-center
utilities.Control the text color of an element to xl using the
text-xl
utilities.Control the text color of an element to blueGray-600 using the
text-blueGray-600
utilities.Control the text color of an element to sm using the
text-sm
utilities.Control the text color of an element to blueGray-400 using the
text-blueGray-400
utilities.Control the margin on right side of an element to 1rem at only large screen sizes using the
lg:mr-4
utilities.Control the margin on top side of an element to 3rem using the
mt-12
utilities.Control the text color of an element to 4xl using the
text-4xl
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 blueGray-700 using the
text-blueGray-700
utilities.Control the margin on top side of an element to 0rem using the
mt-0
utilities.Control the margin on right side of an element to 0.5rem using the
mr-2
utilities.Control the text color of an element to lg using the
text-lg
utilities.Control the margin on top side of an element to 2.5rem using the
mt-10
utilities.Control the vertical padding of an element to 2.5rem using the
py-10
utilities.Control the border color of an element to t using the
border-t
utilities.Control the border color of an element to blueGray-200 using the
border-blueGray-200
utilities.Use
lg:w-9/12
to set an element to a fixed width(9/12) at only large screen sizes.Control the margin on bottom side of an element to 1rem using the
mb-4
utilities.Control the text color of an element to pink-500 using the
text-pink-500
utilities.Control the padding on bottom side of an element to 1.5rem using the
pb-6
utilities.Control the margin on top side of an element to 2rem using the
mt-8
utilities.Use
md:w-6/12
to set an element to a fixed width(6/12) at only medium screen sizes.Control the text color of an element to blueGray-500 using the
text-blueGray-500
utilities.Control the vertical padding of an element to 0.25rem using the
py-1
utilities.Control the text color of an element to gray-800 on hover using the
hover:text-gray-800
utilities.Control the text color of an element to blueGray-800 on hover using the
hover:text-blueGray-800
utilities.
Conclusion
The above is a step-by-step tutorial on how to use Tailwind CSS to build a Profile Page components, learn and follow along to implement your own components.