Published on

Learn How To Make A 404 Page Template With Tailwind CSS Like an Expert

404 Page Template

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 404 Page Template ui component

Responsive 404 page template (only v3 compatible) play.tailwindcss.com/niyompyhru

Why use Tailwind CSS to build a 404 Page Template ui component?

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

The preview of 404 Page Template ui component

Free download of the 404 Page Template's source code

The source code of 404 Page Template ui component

<!-- MDI Icons -->
<link rel="stylesheet" href="https://cdn.materialdesignicons.com/6.5.95/css/materialdesignicons.min.css">

<!-- Page Container -->
<div class="flex items-center justify-center min-h-screen bg-white py-48">
    <div class="flex flex-col">
        <!-- Notes -->
        <span class="text-center font-bold my-10 opacity-30">
            MDI (npm i @mdi/font) reuqired for all icons

            <hr class="my-4">

            <a href="https://egoistdeveloper.github.io/twcss-to-sass-playground/" target="_blank" class="text-blue-600">
                Convetert to SASS
            </a>
        </span>

        <!-- Error Container -->
        <div class="flex flex-col items-center">
            <div class="text-indigo-500 font-bold text-7xl">
                404
            </div>

            <div class="font-bold text-3xl xl:text-7xl lg:text-6xl md:text-5xl mt-10">
                This page does not exist
            </div>

            <div class="text-gray-400 font-medium text-sm md:text-xl lg:text-2xl mt-8">
                The page you are looking for could not be found.
            </div>
        </div>

        <!-- Continue With -->
        <div class="flex flex-col mt-48">
            <div class="text-gray-400 font-bold uppercase">
                Continue With
            </div>

            <div class="flex flex-col items-stretch mt-5">
                <!-- Nav Item #1 -->
                <div class="flex flex-row group px-4 py-8
                    border-t hover:cursor-pointer
                    transition-all duration-200 delay-100">

                    <!-- Nav Icon -->
                    <div class="rounded-xl bg-blue-100 px-3 py-2 md:py-4">
                        <i class="mdi mdi-home-outline mx-auto 
                            text-indigo-900 text-2xl md:text-3xl"></i>
                    </div>

                    <!-- Text -->
                    <div class="grow flex flex-col pl-5 pt-2">
                        <div class="font-bold text-sm md:text-lg lg:text-xl group-hover:underline">
                            Home Page
                        </div>

                        <div class="font-semibold text-sm md:text-md lg:text-lg
                            text-gray-400 group-hover:text-gray-500
                            transition-all duration-200 delay-100">
                            Everything starts here
                        </div>
                    </div>

                    <!-- Chevron -->
                    <i class="mdi mdi-chevron-right text-gray-400 mdi-24px my-auto pr-2
                        group-hover:text-gray-700 transition-all duration-200 delay-100"></i>
                </div>

                <!-- Nav Item #2 -->
                <div class="flex flex-row group px-4 py-8
                    border-t hover:cursor-pointer
                    transition-all duration-200 delay-100">

                    <!-- Nav Icon -->
                    <div class="rounded-xl bg-blue-100 px-3 py-2 md:py-4">
                        <i class="mdi mdi-book-open-page-variant-outline mx-auto 
                            text-indigo-800 text-2xl md:text-3xl"></i>
                    </div>

                    <!-- Text -->
                    <div class="grow flex flex-col pl-5 pt-2">
                        <div class="font-bold text-sm md:text-lg lg:text-xl group-hover:underline">
                            Blog
                        </div>

                        <div class="font-semibold text-sm md:text-md lg:text-lg
                            text-gray-400 group-hover:text-gray-500
                            transition-all duration-200 delay-100">
                            Read our awesome articles
                        </div>
                    </div>

                    <!-- Chevron -->
                    <i class="mdi mdi-chevron-right text-gray-400 mdi-24px my-auto pr-2
                        group-hover:text-gray-700 transition-all duration-200 delay-100"></i>
                </div>

                <!-- Nav Item #3 -->
                <div class="flex flex-row group px-4 py-8
                    border-t hover:cursor-pointer
                    transition-all duration-200 delay-100">

                    <!-- Nav Icon -->
                    <div class="rounded-xl bg-blue-100 px-3 py-2 md:py-4">
                        <i class="mdi mdi-archive-settings-outline 
                            mx-auto text-indigo-800 text-2xl md:text-3xl"></i>
                    </div>

                    <!-- Text -->
                    <div class="grow flex flex-col pl-5 pt-2">
                        <div class="font-bold text-sm md:text-lg lg:text-xl group-hover:underline">
                            Archive
                        </div>

                        <div class="font-semibold text-sm md:text-md lg:text-lg
                            text-gray-400 group-hover:text-gray-500
                            transition-all duration-200 delay-100">
                            Archived posts but still readable
                        </div>
                    </div>

                    <!-- Chevron -->
                    <i class="mdi mdi-chevron-right text-gray-400 mdi-24px my-auto pr-2
                        group-hover:text-gray-700 transition-all duration-200 delay-100"></i>
                </div>

                <!-- Nav Item #3 -->
                <div class="flex flex-row group px-4 py-8
                    border-t hover:cursor-pointer
                    transition-all duration-200 delay-100">

                    <!-- Nav Icon -->
                    <div class="rounded-xl bg-blue-100 px-3 py-2 md:py-4">
                        <i class="mdi mdi-at mx-auto 
                            text-indigo-800 text-2xl md:text-3xl"></i>
                    </div>

                    <!-- Text -->
                    <div class="grow flex flex-col pl-5 pt-2">
                        <div class="font-bold text-sm md:text-lg lg:text-xl group-hover:underline">
                            Contact
                        </div>

                        <div class="font-semibold text-sm md:text-md lg:text-lg
                            text-gray-400 group-hover:text-gray-500
                            transition-all duration-200 delay-100">
                            Contact us for your questions
                        </div>
                    </div>

                    <!-- Chevron -->
                    <i class="mdi mdi-chevron-right text-gray-400 mdi-24px my-auto pr-2
                        group-hover:text-gray-700 transition-all duration-200 delay-100"></i>
                </div>
            </div>
        </div>
    </div>
</div>

How to build a 404 Page Template with Tailwind CSS?

Install tailwind css of verion 3.0.18

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

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

All the unility class needed to build a 404 Page Template component

  • flex
  • min-h-screen
  • bg-white
  • py-48
  • flex-col
  • text-center
  • my-10
  • my-4
  • text-blue-600
  • text-indigo-500
  • text-7xl
  • text-3xl
  • xl:text-7xl
  • lg:text-6xl
  • md:text-5xl
  • mt-10
  • text-gray-400
  • text-sm
  • md:text-xl
  • lg:text-2xl
  • mt-8
  • mt-48
  • mt-5
  • flex-row
  • px-4
  • border-t
  • bg-blue-100
  • px-3
  • py-2
  • md:py-4
  • mx-auto
  • text-indigo-900
  • text-2xl
  • md:text-3xl
  • pl-5
  • pt-2
  • md:text-lg
  • lg:text-xl
  • md:text-md
  • my-auto
  • group-hover:text-gray-700
  • text-indigo-800

42 steps to build a 404 Page Template component with Tailwind CSS

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

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

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

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

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

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

  7. Control the vertical margin of an element to 2.5rem using the my-10 utilities.

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

  9. Control the text color of an element to blue-600 using the text-blue-600 utilities.

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

  11. Control the text color of an element to 7xl using the text-7xl 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 7xl at only extremely large screen sizes using the xl:text-7xl utilities.

  14. Control the text color of an element to 6xl at only large screen sizes using the lg:text-6xl utilities.

  15. Control the text color of an element to 5xl at only medium screen sizes using the md:text-5xl utilities.

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

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

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

  19. Control the text color of an element to xl at only medium screen sizes using the md:text-xl utilities.

  20. Control the text color of an element to 2xl at only large screen sizes using the lg:text-2xl utilities.

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

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

  23. Control the margin on top side of an element to 1.25rem using the mt-5 utilities.

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

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

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

  27. Control the background color of an element to blue-100 using the bg-blue-100 utilities.

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

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

  30. Control the vertical padding of an element to 1rem at only medium screen sizes using the md:py-4 utilities.

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

  32. Control the text color of an element to indigo-900 using the text-indigo-900 utilities.

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

  34. Control the text color of an element to 3xl at only medium screen sizes using the md:text-3xl utilities.

  35. Set the left padding of the element to 1.25rem using the pl-5 utilities class

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

  37. Control the text color of an element to lg at only medium screen sizes using the md:text-lg utilities.

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

  39. Control the text color of an element to md at only medium screen sizes using the md:text-md utilities.

  40. Control the vertical margin of an element to auto using the my-auto utilities.

  41. Control the text color of an element to gray-700undefined using the group-hover:text-gray-700 utilities.

  42. Control the text color of an element to indigo-800 using the text-indigo-800 utilities.

Conclusion

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