Published on

6 Easy Ways To Build A Responsive Horizontal Pricing With Tailwind CSS Without Even Thinking About It

Tags
Responsive Horizontal Pricing

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 Responsive Horizontal Pricing ui component

Responsive horizontal pricing cards with tailwind css

Why use Tailwind CSS to build a Responsive Horizontal Pricing ui component?

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

The preview of Responsive Horizontal Pricing ui component

Free download of the Responsive Horizontal Pricing's source code

The source code of Responsive Horizontal Pricing ui component

<section class="bg-black ">
            <div class="container px-5 py-12 mx-auto lg:px-20">
                <div class="flex flex-col flex-wrap pb-6 mb-12 text-white ">
                    <h1 class="mb-12 text-3xl font-medium text-white">
                        Pricing Cards
                    </h1>
                    <p class="text-base leading-relaxed">
                        Wide + Double.</p>
                </div>
                <div
                    class="flex flex-wrap items-end justify-start w-full transition duration-500 ease-in-out transform bg-black border-2 border-gray-600 rounded-lg hover:border-white ">
                    <div class="w-full xl:w-1/4 md:w-1/4">
                        <div class="relative flex flex-col h-full p-8 ">
                            <h2 class="mb-4 font-semibold tracking-widest text-white uppercase title-font">
                                Sponsorships
                            </h2>
                            <p class="flex items-center mb-2 text-lg font-normal tracking-wide text-white">
                                <span
                                    class="inline-flex items-center justify-center flex-shrink-0 w-5 h-5 mr-2 text-white rounded-full bg-blue-1300">
                                    <svg fill="none" stroke="currentColor" stroke-linecap="round"
                                        stroke-linejoin="round" stroke-width="2.5" class="w-4 h-4" viewBox="0 0 24 24">
                                        <path d="M20 6L9 17l-5-5"></path>
                                    </svg>
                                </span>Feature.
                            </p>
                            <p class="flex items-center mb-2 text-lg font-normal tracking-wide text-white">
                                <span
                                    class="inline-flex items-center justify-center flex-shrink-0 w-5 h-5 mr-2 text-white rounded-full bg-blue-1300">
                                    <svg fill="none" stroke="currentColor" stroke-linecap="round"
                                        stroke-linejoin="round" stroke-width="2.5" class="w-4 h-4" viewBox="0 0 24 24">
                                        <path d="M20 6L9 17l-5-5"></path>
                                    </svg>
                                </span>Feature.
                            </p>
                            <p class="flex items-center mb-2 text-lg font-normal tracking-wide text-white">
                                <span
                                    class="inline-flex items-center justify-center flex-shrink-0 w-5 h-5 mr-2 text-white rounded-full bg-blue-1300">
                                    <svg fill="none" stroke="currentColor" stroke-linecap="round"
                                        stroke-linejoin="round" stroke-width="2.5" class="w-4 h-4" viewBox="0 0 24 24">
                                        <path d="M20 6L9 17l-5-5"></path>
                                    </svg>
                                </span>Feature.
                            </p>
                        </div>
                    </div>
                    <div class="w-full xl:w-1/4 md:w-1/4">
                        <div class="relative flex flex-col h-full p-8 ">
                            <p class="flex items-center mb-2 text-lg font-normal tracking-wide text-white">
                                <span
                                    class="inline-flex items-center justify-center flex-shrink-0 w-5 h-5 mr-2 text-white rounded-full bg-blue-1300">
                                    <svg fill="none" stroke="currentColor" stroke-linecap="round"
                                        stroke-linejoin="round" stroke-width="2.5" class="w-4 h-4" viewBox="0 0 24 24">
                                        <path d="M20 6L9 17l-5-5"></path>
                                    </svg>
                                </span>Feature.
                            </p>
                            <p class="flex items-center mb-2 text-lg font-normal tracking-wide text-gray-400">
                                <span
                                    class="inline-flex items-center justify-center flex-shrink-0 w-5 h-5 mr-2 text-gray-400 rounded-full bg-blue-1300">
                                    <svg fill="none" stroke="currentColor" stroke-linecap="round"
                                        stroke-linejoin="round" stroke-width="2.5" class="w-4 h-4" viewBox="0 0 24 24">
                                        <path
                                            d="M6 18L18 6M6 6l12 12" />
                                    </svg>
                                </span>Feature.
                            </p>
                            <p class="flex items-center mb-2 text-lg font-normal tracking-wide text-gray-400">
                                <span
                                    class="inline-flex items-center justify-center flex-shrink-0 w-5 h-5 mr-2 text-gray-400 rounded-full bg-blue-1300">
                                    <svg fill="none" stroke="currentColor" stroke-linecap="round"
                                        stroke-linejoin="round" stroke-width="2.5" class="w-4 h-4" viewBox="0 0 24 24">
                                        <path
                                            d="M6 18L18 6M6 6l12 12" />
                                    </svg>
                                </span>Feature.
                            </p>
                        </div>
                    </div>
                    <div class="w-full xl:w-1/4 md:w-1/4">
                        <div class="relative flex flex-col h-full p-8 ">
                            <p class="flex items-center mb-2 text-lg font-normal tracking-wide text-gray-400">
                                <span
                                    class="inline-flex items-center justify-center flex-shrink-0 w-5 h-5 mr-2 text-gray-400 rounded-full bg-blue-1300">
                                    <svg fill="none" stroke="currentColor" stroke-linecap="round"
                                        stroke-linejoin="round" stroke-width="2.5" class="w-4 h-4" viewBox="0 0 24 24">
                                        <path
                                            d="M6 18L18 6M6 6l12 12" />
                                    </svg>
                                </span>Feature.
                            </p>
                            <p class="flex items-center mb-2 text-lg font-normal tracking-wide text-gray-400">
                                <span
                                    class="inline-flex items-center justify-center flex-shrink-0 w-5 h-5 mr-2 text-gray-400 rounded-full bg-blue-1300">
                                    <svg fill="none" stroke="currentColor" stroke-linecap="round"
                                        stroke-linejoin="round" stroke-width="2.5" class="w-4 h-4" viewBox="0 0 24 24">
                                        <path
                                            d="M6 18L18 6M6 6l12 12" />
                                    </svg>
                                </span>Feature.
                            </p>
                            <p class="flex items-center mb-2 text-lg font-normal tracking-wide text-gray-400">
                                <span
                                    class="inline-flex items-center justify-center flex-shrink-0 w-5 h-5 mr-2 text-gray-400 rounded-full bg-blue-1300">
                                    <svg fill="none" stroke="currentColor" stroke-linecap="round"
                                        stroke-linejoin="round" stroke-width="2.5" class="w-4 h-4" viewBox="0 0 24 24">
                                        <path
                                            d="M6 18L18 6M6 6l12 12" />
                                    </svg>
                                </span>Feature.
                            </p>
                        </div>
                    </div>
                    <div class="w-full xl:w-1/4 md:w-1/4 lg:ml-auto">
                        <div class="relative flex flex-col h-full p-8">
                            <h1 class="flex items-end mx-auto text-3xl font-black leading-none text-white ">
                                <span>$10 </span>
                            </h1>
                            <button
                                class="w-full px-4 py-2 mx-auto mt-3 text-white transition duration-500 ease-in-out transform border border-gray-900 rounded-lg text-md hover:bg-gray-900 focus:shadow-outline focus:outline-none focus:ring-2 ring-offset-current ring-offset-2 focus:border-gray-700 focus:bg-gray-800 ">Buy
                                Now
                            </button>
                            <p class="mx-auto mt-6 text-xs text-white">Only once within 6 months</p>
                        </div>
                    </div>
                </div>
                <div
                    class="flex flex-wrap items-end justify-start w-full mt-10 transition duration-500 ease-in-out transform bg-black border-2 border-gray-600 rounded-lg hover:border-white ">
                    <div class="w-full xl:w-1/4 md:w-1/4">
                        <div class="relative flex flex-col h-full p-8 ">
                            <h2 class="mb-4 font-semibold tracking-widest text-white uppercase title-font">
                                Sponsorships
                            </h2>
                            <p class="flex items-center mb-2 text-lg font-normal tracking-wide text-white">
                                <span
                                    class="inline-flex items-center justify-center flex-shrink-0 w-5 h-5 mr-2 text-white rounded-full bg-blue-1300">
                                    <svg fill="none" stroke="currentColor" stroke-linecap="round"
                                        stroke-linejoin="round" stroke-width="2.5" class="w-4 h-4" viewBox="0 0 24 24">
                                        <path d="M20 6L9 17l-5-5"></path>
                                    </svg>
                                </span>Feature.
                            </p>
                            <p class="flex items-center mb-2 text-lg font-normal tracking-wide text-white">
                                <span
                                    class="inline-flex items-center justify-center flex-shrink-0 w-5 h-5 mr-2 text-white rounded-full bg-blue-1300">
                                    <svg fill="none" stroke="currentColor" stroke-linecap="round"
                                        stroke-linejoin="round" stroke-width="2.5" class="w-4 h-4" viewBox="0 0 24 24">
                                        <path d="M20 6L9 17l-5-5"></path>
                                    </svg>
                                </span>Feature.
                            </p>
                            <p class="flex items-center mb-2 text-lg font-normal tracking-wide text-white">
                                <span
                                    class="inline-flex items-center justify-center flex-shrink-0 w-5 h-5 mr-2 text-white rounded-full bg-blue-1300">
                                    <svg fill="none" stroke="currentColor" stroke-linecap="round"
                                        stroke-linejoin="round" stroke-width="2.5" class="w-4 h-4" viewBox="0 0 24 24">
                                        <path d="M20 6L9 17l-5-5"></path>
                                    </svg>
                                </span>Feature.
                            </p>
                        </div>
                    </div>
                    <div class="w-full xl:w-1/4 md:w-1/4">
                        <div class="relative flex flex-col h-full p-8 ">
                            <p class="flex items-center mb-2 text-lg font-normal tracking-wide text-white">
                                <span
                                    class="inline-flex items-center justify-center flex-shrink-0 w-5 h-5 mr-2 text-white rounded-full bg-blue-1300">
                                    <svg fill="none" stroke="currentColor" stroke-linecap="round"
                                        stroke-linejoin="round" stroke-width="2.5" class="w-4 h-4" viewBox="0 0 24 24">
                                        <path d="M20 6L9 17l-5-5"></path>
                                    </svg>
                                </span>Feature.
                            </p>
                            <p class="flex items-center mb-2 text-lg font-normal tracking-wide text-white">
                                <span
                                    class="inline-flex items-center justify-center flex-shrink-0 w-5 h-5 mr-2 text-white rounded-full bg-blue-1300">
                                    <svg fill="none" stroke="currentColor" stroke-linecap="round"
                                        stroke-linejoin="round" stroke-width="2.5" class="w-4 h-4" viewBox="0 0 24 24">
                                        <path d="M20 6L9 17l-5-5"></path>
                                    </svg>
                                </span>Feature.
                            </p>
                            <p class="flex items-center mb-2 text-lg font-normal tracking-wide text-white">
                                <span
                                    class="inline-flex items-center justify-center flex-shrink-0 w-5 h-5 mr-2 text-white rounded-full bg-blue-1300">
                                    <svg fill="none" stroke="currentColor" stroke-linecap="round"
                                        stroke-linejoin="round" stroke-width="2.5" class="w-4 h-4" viewBox="0 0 24 24">
                                        <path d="M20 6L9 17l-5-5"></path>
                                    </svg>
                                </span>Feature.
                            </p>
                        </div>
                    </div>
                    <div class="w-full xl:w-1/4 md:w-1/4">
                        <div class="relative flex flex-col h-full p-8 ">
                            <p class="flex items-center mb-2 text-lg font-normal tracking-wide text-white">
                                <span
                                    class="inline-flex items-center justify-center flex-shrink-0 w-5 h-5 mr-2 text-white rounded-full bg-blue-1300">
                                    <svg fill="none" stroke="currentColor" stroke-linecap="round"
                                        stroke-linejoin="round" stroke-width="2.5" class="w-4 h-4" viewBox="0 0 24 24">
                                        <path d="M20 6L9 17l-5-5"></path>
                                    </svg>
                                </span>Feature.
                            </p>
                            <p class="flex items-center mb-2 text-lg font-normal tracking-wide text-white">
                                <span
                                    class="inline-flex items-center justify-center flex-shrink-0 w-5 h-5 mr-2 text-white rounded-full bg-blue-1300">
                                    <svg fill="none" stroke="currentColor" stroke-linecap="round"
                                        stroke-linejoin="round" stroke-width="2.5" class="w-4 h-4" viewBox="0 0 24 24">
                                        <path d="M20 6L9 17l-5-5"></path>
                                    </svg>
                                </span>Feature.
                            </p>
                            <p class="flex items-center mb-2 text-lg font-normal tracking-wide text-white">
                                <span
                                    class="inline-flex items-center justify-center flex-shrink-0 w-5 h-5 mr-2 text-white rounded-full bg-blue-1300">
                                    <svg fill="none" stroke="currentColor" stroke-linecap="round"
                                        stroke-linejoin="round" stroke-width="2.5" class="w-4 h-4" viewBox="0 0 24 24">
                                        <path d="M20 6L9 17l-5-5"></path>
                                    </svg>
                                </span>Feature.
                            </p>
                        </div>
                    </div>
                    <div class="w-full xl:w-1/4 md:w-1/4 lg:ml-auto">
                        <div class="relative flex flex-col h-full p-8">
                            <h1 class="flex items-end mx-auto text-3xl font-black leading-none text-white ">
                                <span>$50 </span>
                            </h1>
                            <button
                                class="w-full px-4 py-2 mx-auto mt-3 text-blue-100 transition duration-500 ease-in-out transform bg-blue-600 border-blue-600 rounded-md items-centerw-full text-md focus:shadow-outline focus:outline-none focus:ring-2 ring-offset-current ring-offset-2 hover:bg-blue-800 ">Buy
                                Now
                            </button>
                            <p class="mx-auto mt-6 text-xs text-white">Only once within 6 months</p>
                        </div>
                    </div>
                </div>
            </div>
            <a href="http://wickedtemplates.com/?ref=codepen" target="_blank"
                class="fixed bottom-0 right-0 z-10 m-2 rounded-full">
                <div class="items-center justify-start hidden font-medium text-gray-900 lg:flex w-52 title-font">
                    <img class="object-cover object-center rounded-full bg-blue-1300" alt="badge"
                        src="https://www.colorsandfonts.com/WickedTemplates.svg">
                </div>
            </a>
        </section>

How to build a Responsive Horizontal Pricing 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 build a Responsive Horizontal Pricing component

  • bg-black
  • px-5
  • py-12
  • mx-auto
  • lg:px-20
  • flex
  • flex-col
  • flex-wrap
  • pb-6
  • mb-12
  • text-white
  • text-3xl
  • text-base
  • justify-start
  • w-full
  • border-2
  • border-gray-600
  • hover:border-white
  • xl:w-1/4
  • md:w-1/4
  • relative
  • h-full
  • p-8
  • mb-4
  • mb-2
  • text-lg
  • inline-flex
  • flex-shrink-0
  • w-5
  • h-5
  • mr-2
  • bg-blue-1300
  • w-4
  • h-4
  • text-gray-400
  • lg:ml-auto
  • px-4
  • py-2
  • mt-3
  • border-gray-900
  • text-md
  • hover:bg-gray-900
  • focus:border-gray-700
  • focus:bg-gray-800
  • mt-6
  • text-xs
  • mt-10
  • text-blue-100
  • bg-blue-600
  • border-blue-600
  • hover:bg-blue-800
  • fixed
  • bottom-0
  • right-0
  • z-10
  • m-2
  • hidden
  • text-gray-900
  • lg:flex
  • w-52

60 steps to build a Responsive Horizontal Pricing component with Tailwind CSS

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

  2. Control the horizontal padding of an element to 1.25rem using the px-5 utilities.

  3. Control the vertical padding of an element to 3rem using the py-12 utilities.

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

  5. Control the horizontal padding of an element to 5rem at only large screen sizes using the lg:px-20 utilities.

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

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

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

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

  10. Control the margin on bottom side of an element to 3rem using the mb-12 utilities.

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

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

  13. Control the text color of an element to base using the text-base utilities.

  14. Use justify-start to justify items against the start of the container’s main axis.

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

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

  17. Control the border color of an element to gray-600 using the border-gray-600 utilities.

  18. Control the border color of an element to white using the hover:border-white utilities on hover.

  19. Use xl:w-1/4 to set an element to a fixed width(1/4) at only extremely large screen sizes.

  20. Use md:w-1/4 to set an element to a fixed width(1/4) at only medium screen sizes.

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

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

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

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

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

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

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

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

  29. Use w-5 to set an element to a fixed width(1.25rem).

  30. Use h-5 to set an element to a fixed height(1.25rem).

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

  32. Control the background color of an element to blue-1300 using the bg-blue-1300 utilities.

  33. Use w-4 to set an element to a fixed width(1rem).

  34. Use h-4 to set an element to a fixed height(1rem).

  35. Control the text color of an element to gray-400 using the text-gray-400 utilities.

  36. Control the margin on left side of an element to auto at only large screen sizes using the lg:ml-auto utilities.

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

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

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

  40. Control the border color of an element to gray-900 using the border-gray-900 utilities.

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

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

  43. Control the border color of an element to gray-700 using the focus:border-gray-700 utilities on focus.

  44. Control the background color of an element to gray-800 using the focus:bg-gray-800 utilities on focus.

  45. Control the margin on top side of an element to 1.5rem using the mt-6 utilities.

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

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

  48. Control the text color of an element to blue-100 using the text-blue-100 utilities.

  49. Control the background color of an element to blue-600 using the bg-blue-600 utilities.

  50. Control the border color of an element to blue-600 using the border-blue-600 utilities.

  51. Control the background color of an element to blue-800 using the hover:bg-blue-800 utilities on hover.

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

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

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

  55. Control the stack order (or three-dimensional positioning) of an element to 10 in Tailwind, regardless of order it has been displayed, using the z-10 utilities.

  56. Control the margin on all sides of an element to 0.5rem using the m-2 utilities.

  57. Use hidden to set an element to display: none and remove it from the page layout.

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

  59. Use flex to create a block-level flex container at only large screen sizes.

  60. Use w-52 to set an element to a fixed width(13rem).

Conclusion

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