agyanadda@gmail.com

Tailwind Landing Page Project

Building Components 1 min read Updated Dec 1, 2026 Topic 23 of 27

Combine everything you learned into one modern, responsive landing page.

Sections

  1. Hero — gradient background, big heading, two buttons and an image, two columns on desktop (grid md:grid-cols-2)
  2. Stats — four numbers in a grid
  3. Features — cards with icons (sm:grid-cols-2 lg:grid-cols-3)
  4. Call to action — a coloured banner with a button
  5. Footer — dark background, small text

Utilities used

max-w-6xl mx-auto px-4, py-16 md:py-24, bg-linear-to-br, text-4xl md:text-6xl, grid, gap-*, rounded-2xl, shadow-*, hover: and transition.

Your turn

  • Add the responsive navbar from the previous lesson
  • Add dark mode with dark: classes
  • Change the brand colour with @theme

Example

Example — Responsive landing page HTML
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>

<section class="bg-linear-to-br from-indigo-600 to-violet-700 text-white">
  <div class="max-w-6xl mx-auto px-4 py-16 md:py-24 grid md:grid-cols-2 gap-10 items-center">
    <div>
      <span class="inline-block bg-white/15 text-sm px-3 py-1 rounded-full">New batch starts Monday</span>
      <h1 class="mt-4 text-4xl md:text-5xl font-extrabold leading-tight">Become a Web Developer in 6 Months</h1>
      <p class="mt-4 text-indigo-100 text-lg">Live classes, real projects and placement support — learn HTML, CSS, Tailwind, JavaScript and PHP.</p>
      <div class="mt-8 flex flex-col sm:flex-row gap-3">
        <a href="#" class="bg-white text-indigo-700 font-semibold px-6 py-3 rounded-xl text-center hover:bg-indigo-50">Join now</a>
        <a href="#features" class="border border-white/40 font-semibold px-6 py-3 rounded-xl text-center hover:bg-white/10">See features</a>
      </div>
    </div>
    <img src="https://picsum.photos/id/3/700/500" class="rounded-2xl shadow-2xl" alt="Students coding">
  </div>
</section>

<section class="max-w-6xl mx-auto px-4 -mt-10">
  <div class="grid grid-cols-2 md:grid-cols-4 gap-4 bg-white rounded-2xl shadow-lg p-6 text-center">
    <div><p class="text-3xl font-bold text-indigo-600">5,000+</p><p class="text-sm text-slate-500">Students</p></div>
    <div><p class="text-3xl font-bold text-indigo-600">19</p><p class="text-sm text-slate-500">Courses</p></div>
    <div><p class="text-3xl font-bold text-indigo-600">4.9★</p><p class="text-sm text-slate-500">Rating</p></div>
    <div><p class="text-3xl font-bold text-indigo-600">100%</p><p class="text-sm text-slate-500">Practical</p></div>
  </div>
</section>

<section id="features" class="max-w-6xl mx-auto px-4 py-16">
  <h2 class="text-3xl font-bold text-center">Why learn with us?</h2>
  <div class="mt-10 grid sm:grid-cols-2 lg:grid-cols-3 gap-6">
    <div class="p-6 rounded-2xl border border-slate-200 hover:shadow-lg transition"><div class="size-12 rounded-xl bg-indigo-100 text-indigo-600 flex items-center justify-center text-2xl">🎥</div><h3 class="mt-4 font-semibold text-lg">Live Classes</h3><p class="text-slate-600 mt-1">Ask doubts in real time with your mentor.</p></div>
    <div class="p-6 rounded-2xl border border-slate-200 hover:shadow-lg transition"><div class="size-12 rounded-xl bg-emerald-100 text-emerald-600 flex items-center justify-center text-2xl">💻</div><h3 class="mt-4 font-semibold text-lg">Real Projects</h3><p class="text-slate-600 mt-1">Build a portfolio that gets you interviews.</p></div>
    <div class="p-6 rounded-2xl border border-slate-200 hover:shadow-lg transition"><div class="size-12 rounded-xl bg-amber-100 text-amber-600 flex items-center justify-center text-2xl">🏆</div><h3 class="mt-4 font-semibold text-lg">Certificate</h3><p class="text-slate-600 mt-1">Get certified when you complete the course.</p></div>
  </div>
</section>

<section class="max-w-6xl mx-auto px-4 pb-16">
  <div class="rounded-2xl bg-slate-900 text-white p-8 md:p-12 flex flex-col md:flex-row items-center justify-between gap-6">
    <h2 class="text-2xl md:text-3xl font-bold">Ready to start your coding journey?</h2>
    <a href="#" class="bg-amber-400 hover:bg-amber-300 text-slate-900 font-semibold px-6 py-3 rounded-xl">Enroll today</a>
  </div>
</section>

<footer class="bg-slate-950 text-slate-400 text-sm text-center py-6">© 2026 CodeClass · Built with Tailwind CSS</footer>

Test Yourself With Exercises

Exercise 1 Multiple Choice

Which classes make the hero two columns on desktop and one on phones?

Exercise 2 True / False

-mt-10 pulls the stats box up so it overlaps the hero section.

Exercise 3 Fill in the Blank

max-w-6xl mx-___ px-4 is a common centred page wrapper.

Frequently Asked Questions

For practice, yes. On real sites use an icon set such as Heroicons or Lucide (SVG), which look consistent everywhere.