Published on

Most Effective Ways To Build A Profile Page With Tailwind CSS

Profile Page

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&amp;ixid=eyJhcHBfaWQiOjEyMDd9&amp;auto=format&amp;fit=crop&amp;w=2710&amp;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

  1. Use relative to position an element according to the normal flow of the document.

  2. Use inline utilities to put the element on its own line and fill its parent.

  3. Use h-500-px to set an element to a fixed height(500-px).

  4. 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.

  5. Use the top-0 utilities to set the top position of a positioned element to 0rem.

  6. Use w-full to set an element to a 100% based width.

  7. Use h-full to set an element’s height to 100% of its parent, as long as the parent has a defined height.

  8. Control the background color of an element to center using the bg-center utilities.

  9. Control the background color of an element to cover using the bg-cover utilities.

  10. Control the background color of an element to black using the bg-black utilities.

  11. Use the top-auto utilities to set the top position of a positioned element to auto.

  12. Use the bottom-0 utilities to set the bottom position of a positioned element to 0rem.

  13. Use the left-0 utilities to set the left position of a positioned element to 0rem.

  14. Use the right-0 utilities to set the right position of a positioned element to 0rem.

  15. Use overflow-hidden to clip any content within an element that overflows the bounds of that element.

  16. Use h-70-px to set an element to a fixed height(70-px).

  17. Control the text color of an element to blueGray-200 using the text-blueGray-200 utilities.

  18. Control the vertical padding of an element to 4rem using the py-16 utilities.

  19. Control the background color of an element to blueGray-200 using the bg-blueGray-200 utilities.

  20. Control the horizontal margin of an element to auto using the mx-auto utilities.

  21. Control the horizontal padding of an element to 1rem using the px-4 utilities.

  22. Use flex to create a block-level flex container.

  23. Use flex to create a block-level flex container.

  24. Set the minimum width/height of an element using the min-w-0 utilities.

  25. Control the background color of an element to white using the bg-white utilities.

  26. Control the margin on bottom side of an element to 1.5rem using the mb-6 utilities.

  27. Control the margin on top side of an element to -16rem using the -mt-64 utilities.

  28. Control the horizontal padding of an element to 1.5rem using the px-6 utilities.

  29. Use flex to create a block-level flex container.

  30. Use lg:w-3/12 to set an element to a fixed width(3/12) at only large screen sizes.

  31. Use h-auto to set an element to a fixed height(auto).

  32. Control the border color of an element to none using the border-none utilities.

  33. Control the margin on all sides of an element to -4rem using the -m-16 utilities.

  34. Control the margin on left side of an element to -5rem using the -ml-20 utilities.

  35. Control the margin on left side of an element to -4rem at only large screen sizes using the lg:-ml-16 utilities.

  36. Set the maximum width/height of an element using the max-w-150-px utilities.

  37. Use lg:w-4/12 to set an element to a fixed width(4/12) at only large screen sizes.

  38. Control the text color of an element to right at only large screen sizes using the lg:text-right utilities.

  39. Control the vertical padding of an element to 1.5rem using the py-6 utilities.

  40. Control the horizontal padding of an element to 0.75rem using the px-3 utilities.

  41. Control the margin on top side of an element to 8rem using the mt-32 utilities.

  42. Control the margin on top side of an element to 0rem at only small screen sizes using the sm:mt-0 utilities.

  43. Control the background color of an element to pink-500 using the bg-pink-500 utilities.

  44. Control the background color of an element to pink-600 using the active:bg-pink-600 utilities on active.

  45. Control the text color of an element to white using the text-white utilities.

  46. Control the text color of an element to xs using the text-xs utilities.

  47. Control the vertical padding of an element to 0.5rem using the py-2 utilities.

  48. Control the margin on right side of an element to 0.5rem at only small screen sizes using the sm:mr-2 utilities.

  49. Control the margin on bottom side of an element to 0.25rem using the mb-1 utilities.

  50. Control the vertical padding of an element to 1rem using the py-4 utilities.

  51. Control the padding on top side of an element to 1rem at only large screen sizes using the lg:pt-4 utilities.

  52. Control the padding on top side of an element to 2rem using the pt-8 utilities.

  53. Control the margin on right side of an element to 1rem using the mr-4 utilities.

  54. Control the padding on all sides of an element to 0.75rem using the p-3 utilities.

  55. Control the text color of an element to center using the text-center utilities.

  56. Control the text color of an element to xl using the text-xl utilities.

  57. Control the text color of an element to blueGray-600 using the text-blueGray-600 utilities.

  58. Control the text color of an element to sm using the text-sm utilities.

  59. Control the text color of an element to blueGray-400 using the text-blueGray-400 utilities.

  60. Control the margin on right side of an element to 1rem at only large screen sizes using the lg:mr-4 utilities.

  61. Control the margin on top side of an element to 3rem using the mt-12 utilities.

  62. Control the text color of an element to 4xl using the text-4xl utilities.

  63. Control the margin on bottom side of an element to 0.5rem using the mb-2 utilities.

  64. Control the text color of an element to blueGray-700 using the text-blueGray-700 utilities.

  65. Control the margin on top side of an element to 0rem using the mt-0 utilities.

  66. Control the margin on right side of an element to 0.5rem using the mr-2 utilities.

  67. Control the text color of an element to lg using the text-lg utilities.

  68. Control the margin on top side of an element to 2.5rem using the mt-10 utilities.

  69. Control the vertical padding of an element to 2.5rem using the py-10 utilities.

  70. Control the border color of an element to t using the border-t utilities.

  71. Control the border color of an element to blueGray-200 using the border-blueGray-200 utilities.

  72. Use lg:w-9/12 to set an element to a fixed width(9/12) at only large screen sizes.

  73. Control the margin on bottom side of an element to 1rem using the mb-4 utilities.

  74. Control the text color of an element to pink-500 using the text-pink-500 utilities.

  75. Control the padding on bottom side of an element to 1.5rem using the pb-6 utilities.

  76. Control the margin on top side of an element to 2rem using the mt-8 utilities.

  77. Use md:w-6/12 to set an element to a fixed width(6/12) at only medium screen sizes.

  78. Control the text color of an element to blueGray-500 using the text-blueGray-500 utilities.

  79. Control the vertical padding of an element to 0.25rem using the py-1 utilities.

  80. Control the text color of an element to gray-800 on hover using the hover:text-gray-800 utilities.

  81. 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.