Published on

How To Create A Description Cards With Tailwind CSS From Scratch

Description Cards

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 Description Cards ui component

Description cards about the product

Why use Tailwind CSS to make a Description Cards ui component?

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

The preview of Description Cards ui component

Free download of the Description Cards's source code

The source code of Description Cards 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">


<section class="relative pt-16 bg-blueGray-50">
<div class="container mx-auto">
  <div class="flex flex-wrap items-center">
    <div class="w-10/12 md:w-6/12 lg:w-4/12 px-12 md:px-4 mr-auto ml-auto -mt-78">
      <div class="relative flex flex-col min-w-0 break-words bg-white w-full mb-6 shadow-lg rounded-lg bg-pink-500">
        <img alt="..." src="https://images.unsplash.com/photo-1498050108023-c5249f4df085?ixlib=rb-1.2.1&amp;ixid=eyJhcHBfaWQiOjEyMDd9&amp;auto=format&amp;fit=crop&amp;w=700&amp;q=80" class="w-full align-middle rounded-t-lg">
        <blockquote class="relative p-8 mb-4">
          <svg preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 583 95" class="absolute left-0 w-full block h-95-px -top-94-px">
            <polygon points="-30,95 583,95 583,65" class="text-pink-500 fill-current"></polygon>
          </svg>
          <h4 class="text-xl font-bold text-white">
            Great for your awesome project
          </h4>
          <p class="text-md font-light mt-2 text-white">
            Putting together a page has never been easier than matching
            together pre-made components. From landing pages presentation
            to login areas, you can easily customise and built your pages.
          </p>
        </blockquote>
      </div>
    </div>

    <div class="w-full md:w-6/12 px-4">
      <div class="flex flex-wrap">
        <div class="w-full md:w-6/12 px-4">
          <div class="relative flex flex-col mt-4">
            <div class="px-4 py-5 flex-auto">
              <div class="text-blueGray-500 p-3 text-center inline-flex items-center justify-center w-12 h-12 mb-5 shadow-lg rounded-full bg-white">
                <i class="fas fa-sitemap"></i>
              </div>
              <h6 class="text-xl mb-1 font-semibold">CSS Components</h6>
              <p class="mb-4 text-blueGray-500">
                Notus JS comes with a huge number of Fully Coded CSS
                components.
              </p>
            </div>
          </div>
          <div class="relative flex flex-col min-w-0">
            <div class="px-4 py-5 flex-auto">
              <div class="text-blueGray-500 p-3 text-center inline-flex items-center justify-center w-12 h-12 mb-5 shadow-lg rounded-full bg-white">
                <i class="fas fa-drafting-compass"></i>
              </div>
              <h6 class="text-xl mb-1 font-semibold">
                JavaScript Components
              </h6>
              <p class="mb-4 text-blueGray-500">
                We also feature many dynamic components for React, NextJS,
                Vue and Angular.
              </p>
            </div>
          </div>
        </div>
        <div class="w-full md:w-6/12 px-4">
          <div class="relative flex flex-col min-w-0 mt-4">
            <div class="px-4 py-5 flex-auto">
              <div class="text-blueGray-500 p-3 text-center inline-flex items-center justify-center w-12 h-12 mb-5 shadow-lg rounded-full bg-white">
                <i class="fas fa-newspaper"></i>
              </div>
              <h6 class="text-xl mb-1 font-semibold">Pages</h6>
              <p class="mb-4 text-blueGray-500">
                This extension also comes with 3 sample pages. They are
                fully coded so you can start working instantly.
              </p>
            </div>
          </div>
          <div class="relative flex flex-col min-w-0">
            <div class="px-4 py-5 flex-auto">
              <div class="text-blueGray-500 p-3 text-center inline-flex items-center justify-center w-12 h-12 mb-5 shadow-lg rounded-full bg-white">
                <i class="fas fa-file-alt"></i>
              </div>
              <h6 class="text-xl mb-1 font-semibold">Documentation</h6>
              <p class="mb-4 text-blueGray-500">
                Built by developers for developers. You will love how easy
                is to to work with Notus JS.
              </p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<footer class="relative bg-blueGray-50 pt-8 pb-6 mt-2">
  <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>

How to make a Description Cards 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 make a Description Cards component

  • relative
  • pt-16
  • bg-blueGray-50
  • mx-auto
  • flex
  • flex-wrap
  • w-10/12
  • md:w-6/12
  • lg:w-4/12
  • px-12
  • md:px-4
  • mr-auto
  • ml-auto
  • -mt-78
  • flex-col
  • min-w-0
  • bg-white
  • w-full
  • mb-6
  • bg-pink-500
  • p-8
  • mb-4
  • absolute
  • left-0
  • block
  • h-95-px
  • -top-94-px
  • text-pink-500
  • text-xl
  • text-white
  • text-md
  • mt-2
  • px-4
  • mt-4
  • py-5
  • flex-auto
  • text-blueGray-500
  • p-3
  • text-center
  • inline-flex
  • w-12
  • h-12
  • mb-5
  • mb-1
  • pt-8
  • pb-6
  • text-sm
  • py-1
  • hover:text-gray-800
  • hover:text-blueGray-800

50 steps to make a Description Cards component with Tailwind CSS

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

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

  3. Control the background color of an element to blueGray-50 using the bg-blueGray-50 utilities.

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

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

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

  7. Use w-10/12 to set an element to a fixed width(10/12).

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

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

  10. Control the horizontal padding of an element to 3rem using the px-12 utilities.

  11. Control the horizontal padding of an element to 1rem at only medium screen sizes using the md:px-4 utilities.

  12. Control the margin on right side of an element to auto using the mr-auto utilities.

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

  14. Control the margin on top side of an element to -19.5rem using the -mt-78 utilities.

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

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

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

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

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

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

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

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

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

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

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

  26. Use h-95-px to set an element to a fixed height(95-px).

  27. Use the -top-94-px utilities to set the top position of a positioned element to 94-px.

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

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

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

  31. Control the text color of an element to md using the text-md utilities.

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

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

  34. Control the margin on top side of an element to 1rem using the mt-4 utilities.

  35. Control the vertical padding of an element to 1.25rem using the py-5 utilities.

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

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

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

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

  40. Use inline-flex to create an inline flex container that flows with text.

  41. Use w-12 to set an element to a fixed width(3rem).

  42. Use h-12 to set an element to a fixed height(3rem).

  43. Control the margin on bottom side of an element to 1.25rem using the mb-5 utilities.

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

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

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

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

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

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

  50. 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 make a Description Cards components, learn and follow along to implement your own components.