Published on

Ways To Build A Hieu With Tailwind CSS In 60 Minutes

Tags
Hieu

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 Hieu ui component

Avatar introduce

Why use Tailwind CSS to make a Hieu ui component?

  • It can make the building process of Hieu ui component faster and more easily.
  • Enables building complex responsive layouts and components freely.
  • Minimum lines of CSS code in Hieu component file.

The preview of Hieu ui component

Free download of the Hieu's source code

The source code of Hieu ui component

<div class="relative wrap overflow-hidden p-10 h-full bg-white">
     <div class="container">
          <div
            class="flex flex-col md:grid grid-cols-3 mx-auto p-2 text-blue-50">
            <div class="flex flex-row-reverse md:contents">
              <div class="bg-white col-start-1 col-end-1  pr-8 rounded-xl my-4 ml-auto">
                <img class="leading-tight text-justify" src="https://img.icons8.com/ios/452/warranty.png">
                <h3>Founder</h3>
                <p class="font-bold font-serif text-lg">Person name</p>
               </div>
               <div class="bg-white col-start-2  col-end-2  pr-8 rounded-xl my-4 ml-auto">
                <img class="leading-tight text-justify" src="https://img.icons8.com/ios/452/warranty.png">
                <h3>Director</h3>
                <p class="font-bold font-serif text-lg">Person name</p>
               </div>
               <div class="bg-white col-start-3 col-end-3   pr-8 rounded-xl my-4 ml-auto">
                <img class="leading-tight text-justify" src="https://img.icons8.com/ios/452/warranty.png">
                <h3>Chief of Marketing</h3>
                <p class="font-bold font-serif text-lg">Person name</p>
               </div>
            </div>
          </div>
     </div>
</div>

How to make a Hieu with Tailwind CSS?

Install tailwind css of verion 1.9.6

Use the link html tag to import the stylesheet of Tailwind CSS of the version 1.9.6

<link href=https://unpkg.com/[email protected]/dist/tailwind.min.css rel="stylesheet">

All the unility class needed to make a Hieu component

  • relative
  • overflow-hidden
  • p-10
  • h-full
  • bg-white
  • flex
  • flex-col
  • md:grid
  • grid-cols-3
  • mx-auto
  • p-2
  • text-blue-50
  • flex-row-reverse
  • md:contents
  • pr-8
  • my-4
  • ml-auto
  • text-justify
  • text-lg

19 steps to make a Hieu component with Tailwind CSS

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

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

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

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

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

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

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

  8. Use grid to create a grid container at only medium screen sizes.

  9. Use grid to create a grid container.

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

  11. Control the padding on all sides of an element to 0.5rem using the p-2 utilities.

  12. Control the text color of an element to blue-50 using the text-blue-50 utilities.

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

  14. Use contents to create a “phantom” container whose children act like direct children of the parert at only medium screen sizes.

  15. Control the padding on right side of an element to 2rem using the pr-8 utilities.

  16. Control the vertical margin of an element to 1rem using the my-4 utilities.

  17. Control the margin on left side of an element to auto using the ml-auto utilities.

  18. Control the text color of an element to justify using the text-justify utilities.

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

Conclusion

The above is a step-by-step tutorial on how to use Tailwind CSS to make a Hieu components, learn and follow along to implement your own components.