Published on

6 Easy Ways To Create A Description List Left Align On Card With Tailwind CSS Without Even Thinking About It

description list left align on card

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 list left align on card ui component

Description list left align on card

Why use Tailwind CSS to make a description list left align on card ui component?

  • It can make the building process of description list left align on card ui component faster and more easily.
  • Enables building complex responsive layouts and components freely.
  • Minimum lines of CSS code in description list left align on card component file.

The preview of description list left align on card ui component

Free download of the description list left align on card's source code

The source code of description list left align on card ui component

<!-- This is an example component -->
<div class="min-h-screen flex items-center justify-center px-4">
    
    <div class="max-w-4xl  bg-white w-full rounded-lg shadow-xl">
        <div class="p-4 border-b">
            <h2 class="text-2xl ">
                Applicant Information
            </h2>
            <p class="text-sm text-gray-500">
                Personal details and application. 
            </p>
        </div>
        <div>
            <div class="md:grid md:grid-cols-2 hover:bg-gray-50 md:space-y-0 space-y-1 p-4 border-b">
                <p class="text-gray-600">
                    Full name
                </p>
                <p>
                    Jane Doe
                </p>
            </div>
            <div class="md:grid md:grid-cols-2 hover:bg-gray-50 md:space-y-0 space-y-1 p-4 border-b">
                <p class="text-gray-600">
                    Application for
                </p>
                <p>
                    Product Manager
                </p>
            </div>
            <div class="md:grid md:grid-cols-2 hover:bg-gray-50 md:space-y-0 space-y-1 p-4 border-b">
                <p class="text-gray-600">
                    Email Address
                </p>
                <p>
                    [email protected]
                </p>
            </div>
            <div class="md:grid md:grid-cols-2 hover:bg-gray-50 md:space-y-0 space-y-1 p-4 border-b">
                <p class="text-gray-600">
                    Salary
                </p>
                <p>
                    $ 12000
                </p>
            </div>
            <div class="md:grid md:grid-cols-2 hover:bg-gray-50 md:space-y-0 space-y-1 p-4 border-b">
                <p class="text-gray-600">
                    About
                </p>
                <p>
                    Fugiat ipsum ipsum deserunt culpa aute sint do nostrud anim incididunt cillum culpa consequat. Excepteur qui ipsum aliquip consequat sint. Sit id mollit nulla mollit nostrud in ea officia proident. Irure nostrud pariatur mollit ad adipisicing reprehenderit deserunt qui eu. 
                </p>
            </div>
            <div class="md:grid md:grid-cols-2 hover:bg-gray-50 md:space-y-0 space-y-1 p-4">
                <p class="text-gray-600">
                    Attachments
                </p>
                <div class="space-y-2">
                    <div class="border-2 flex items-center p-2 rounded justify-between space-x-2">
                        <div class="space-x-2 truncate">
                            <svg xmlns="http://www.w3.org/2000/svg" class="fill-current inline text-gray-500" width="24" height="24" viewBox="0 0 24 24"><path d="M17 5v12c0 2.757-2.243 5-5 5s-5-2.243-5-5v-12c0-1.654 1.346-3 3-3s3 1.346 3 3v9c0 .551-.449 1-1 1s-1-.449-1-1v-8h-2v8c0 1.657 1.343 3 3 3s3-1.343 3-3v-9c0-2.761-2.239-5-5-5s-5 2.239-5 5v12c0 3.866 3.134 7 7 7s7-3.134 7-7v-12h-2z"/></svg>
                            <span>
                                resume_for_manager.pdf
                            </span>
                        </div>
                        <a href="#" class="text-purple-700 hover:underline">
                            Download
                        </a>
                    </div>

                    <div class="border-2 flex items-center p-2 rounded justify-between space-x-2">
                        <div class="space-x-2 truncate">
                            <svg xmlns="http://www.w3.org/2000/svg" class="fill-current inline text-gray-500" width="24" height="24" viewBox="0 0 24 24"><path d="M17 5v12c0 2.757-2.243 5-5 5s-5-2.243-5-5v-12c0-1.654 1.346-3 3-3s3 1.346 3 3v9c0 .551-.449 1-1 1s-1-.449-1-1v-8h-2v8c0 1.657 1.343 3 3 3s3-1.343 3-3v-9c0-2.761-2.239-5-5-5s-5 2.239-5 5v12c0 3.866 3.134 7 7 7s7-3.134 7-7v-12h-2z"/></svg>
                            <span>
                                resume_for_manager.pdf
                            </span>
                        </div>
                        <a href="#" class="text-purple-700 hover:underline">
                            Download
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>




    <!-- support me by buying a coffee -->
    <a href="https://www.buymeacoffee.com/danimai" target="_blank" class="bg-purple-600 p-2 rounded-lg text-white fixed right-0 bottom-0">
        Support me
    </a>
</div>

How to make a description list left align on card with Tailwind CSS?

Install tailwind css of verion 2.0.3

Use the script html tag to import the script of Tailwind CSS of the version 2.0.3

<script src="https://cdn.tailwindcss.com"></script>

All the unility class needed to make a description list left align on card component

  • min-h-screen
  • flex
  • px-4
  • max-w-4xl
  • bg-white
  • w-full
  • p-4
  • border-b
  • text-2xl
  • text-sm
  • text-gray-500
  • md:grid
  • md:grid-cols-2
  • hover:bg-gray-50
  • text-gray-600
  • border-2
  • p-2
  • inline
  • text-purple-700
  • bg-purple-600
  • text-white
  • fixed
  • right-0
  • bottom-0

24 steps to make a description list left align on card component with Tailwind CSS

  1. Set the minimum width/height of an element using the min-h-screen utilities.

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

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

  4. Set the maximum width/height of an element using the max-w-4xl utilities.

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

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

  7. Control the padding on all sides of an element to 1rem using the p-4 utilities.

  8. Control the border color of an element to b using the border-b utilities.

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

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

  11. Control the text color of an element to gray-500 using the text-gray-500 utilities.

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

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

  14. Control the background color of an element to gray-50 using the hover:bg-gray-50 utilities on hover.

  15. Control the text color of an element to gray-600 using the text-gray-600 utilities.

  16. Control the border color of an element to 0.5rem using the border-2 utilities.

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

  18. Use inline utilities to control the flow of text inside the element to wrap normally.

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

  20. Control the background color of an element to purple-600 using the bg-purple-600 utilities.

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

  22. Use fixed to position an element relative to the browser window.

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

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

Conclusion

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