Free tutorials & notes in Hindi & English · Clean code examples 🧰 Free PDF & Image Tools →
✨ Days 13–18 – Motion, UI & Professional CSS  ·  Day 18

Day 18: Frameworks: Bootstrap & Tailwind Explained

⏱ 90 min📶 Intermediate → Pro🎯 100% self-study
Day 18 / 20

✅ Today you will learn

  • What a CSS framework is and why companies use them
  • Bootstrap 5: grid, components, utilities
  • Tailwind CSS: utility-first styling
  • Bootstrap vs Tailwind vs your own CSS
  • Customising frameworks and what interviewers expect

🏢 In the real world

Indian job descriptions often say “Bootstrap/Tailwind required”. Many admin panels, school ERPs and SaaS dashboards in the market are built on Bootstrap; most new React/Next.js startups use Tailwind. Because you now understand real CSS, learning either takes hours, not weeks – and you can fix things when the framework is not enough.

What a framework gives you

🧱
Pre-built componentsButtons, cards, navbars, modals, forms.
📐
A grid systemResponsive columns with class names.
🔧
Utility classesmt-3, d-flex, text-center, p-4…
👥
Team consistencyEveryone uses the same vocabulary.
Speed + consistency, at the cost of a learning curve and file size

Bootstrap 5 – components first

HTML
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">

<div class="container py-3">
  <div class="row g-3">
    <div class="col-12 col-sm-6">
      <div class="card shadow-sm h-100">
        <img src="images/kaju-katli-400.webp" class="card-img-top" alt="Kaju katli">
        <div class="card-body d-flex flex-column">
          <h5 class="card-title">Kaju Katli <span class="badge text-bg-success">Veg</span></h5>
          <p class="card-text text-secondary">Cashew fudge with silver vark.</p>
          <a href="#" class="btn btn-primary mt-auto">Add to cart – ₹900</a>
        </div>
      </div>
    </div>
    <div class="col-12 col-sm-6">
      <div class="alert alert-warning mb-3">🪔 Diwali orders close on 30 Oct</div>
      <form class="vstack gap-2">
        <input class="form-control" placeholder="Mobile number">
        <select class="form-select"><option>Kaju katli</option><option>Ghewar</option></select>
        <button class="btn btn-outline-primary">Request call back</button>
      </form>
    </div>
  </div>
</div>
▶  Bootstrap 5.3: grid, card, badge, alert, form – no custom CSS written
Bootstrap classPlain CSS you already know
containermax-width + margin: 0 auto + padding (Day 4)
row / col-12 col-sm-6Flexbox with wrap + media query at 576px (Days 7, 11)
g-3gap between columns
card, card-bodyBox with border, radius, padding (Day 4)
d-flex flex-column … mt-autoThe equal-height button trick (Day 8)
btn btn-primaryYour .btn .btn--primary component (Day 16)
text-secondary, shadow-smUtilities: colour and box-shadow
💡 Customising Bootstrap the right way

Bootstrap 5.3 exposes CSS variables. Instead of overriding .btn-primary with !important, set them: .btn-primary { --bs-btn-bg: #e34f26; --bs-btn-border-color: #e34f26; --bs-btn-hover-bg: #c2410c; }. Link your own style.css AFTER bootstrap.css.

Tailwind CSS – utility first

HTML
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>

<div class="p-4 grid gap-4 sm:grid-cols-2">
  <article class="bg-white rounded-2xl shadow-md overflow-hidden flex flex-col">
    <img src="images/ghewar-400.webp" alt="Ghewar" class="w-full aspect-[4/3] object-cover">
    <div class="p-4 flex flex-col flex-1">
      <h3 class="text-lg font-bold">Malai Ghewar
        <span class="ml-1 rounded-full bg-amber-100 text-amber-800 text-xs px-2 py-0.5">Teej special</span></h3>
      <p class="text-slate-500 text-sm mb-4">Honeycomb disc with rabri.</p>
      <a href="#" class="mt-auto text-center rounded-lg bg-indigo-600 hover:bg-indigo-700 text-white font-semibold py-2">
        Add to cart – ₹650</a>
    </div>
  </article>
  <div class="rounded-2xl bg-gradient-to-br from-indigo-600 to-cyan-500 text-white p-6 flex flex-col justify-center">
    <p class="uppercase tracking-widest text-xs opacity-80">Free delivery</p>
    <p class="text-3xl font-extrabold leading-tight">On orders above ₹1,500</p>
  </div>
</div>
▶  Tailwind 4: every style is a small class in the HTML
Tailwind classCSS it generates
p-4padding: 1rem
rounded-2xlborder-radius: 1rem
grid gap-4 sm:grid-cols-2display: grid; gap: 1rem; 2 columns from 640px (mobile-first!)
flex flex-col flex-1 mt-autoFlexbox column + push to bottom
aspect-[4/3] object-coveraspect-ratio and object-fit (arbitrary value in brackets)
hover:bg-indigo-700Background on :hover
bg-gradient-to-br from-… to-…linear-gradient(to bottom right, …)
⚠️ The browser build is for learning only

The <script> version compiles CSS inside the visitor’s browser – fine for practice, too slow for real sites. In projects install Tailwind with npm (or the Vite/Next.js plugin) so it outputs a small, purged CSS file containing only the classes you used.

Bootstrap vs Tailwind vs hand-written CSS

BootstrapTailwindYour own CSS
StyleReady componentsUtility classes in HTMLSemantic classes (BEM)
LooksRecognisably “Bootstrap” unless customisedFully customFully custom
Speed to first screen⚡ FastestFast after learning namesSlowest at start
CSS file size~230 KB full (can trim)Very small after buildExactly what you write
Best forAdmin panels, ERPs, prototypes, PHP sitesReact/Next.js apps, custom designsBrand websites, learning, small sites
Needs JavaScript?Only for dropdowns/modals (bundle)NoNo
🧠 Our recommendation for freshers

Master plain CSS first (you just did 17 days of it). Then learn Bootstrap in 2–3 days for PHP/admin jobs and Tailwind in 3–4 days for React/Next.js jobs. In interviews, explaining what a framework class does in real CSS is what impresses.

Terminal – real Tailwind setup with Vite (for later)
npm create vite@latest my-site -- --template vanilla
cd my-site
npm install tailwindcss @tailwindcss/vite
# vite.config.js → plugins: [tailwindcss()]
# src/style.css → @import "tailwindcss";
npm run dev

🏅 Job skills unlocked today

✔ Explain what CSS frameworks provide✔ Build layouts and components with Bootstrap 5✔ Style with Tailwind utility classes✔ Choose and customise a framework for a project

Practice tasks

🏋️ Practice – do it yourself

Task 1: Rebuild your Day 8 pricing section in Bootstrap using row, col-md-4, card and btn classes.
Task 2: Rebuild the same pricing section in Tailwind and compare the number of lines and the look.
Task 3: Change Bootstrap’s primary button to Sharma Sweets orange using only --bs-btn-* variables.

Quick quiz

🧠 Quick Quiz – test yourself

1. Bootstrap’s responsive grid is based on…
row/col classes.
2. Tailwind is called…
Small single-purpose classes.
3. sm:grid-cols-2 in Tailwind applies…
Mobile-first breakpoints.
4. Best way to recolour Bootstrap buttons:
Supported customisation.
5. Why not use the Tailwind browser script in production?
Build step instead.

Interview corner

💼 Interview Corner

Bootstrap or Tailwind – which would you choose and why?

It depends on the project: Bootstrap for fast, consistent admin panels or server-rendered PHP apps where ready components save time; Tailwind for custom-designed products, especially React/Next.js, where utility classes and a small built CSS keep design flexible. Plain CSS for small brand sites.

What are the downsides of utility-first CSS?

Long class lists in HTML, a learning curve for class names, repetition unless you extract components, and designs can drift without a shared component layer. Mitigate with components (React, partials) and the config/theme.

Summary

  • Frameworks = ready components, grids and utilities.
  • Bootstrap: component classes, great for admin/PHP apps; customise via --bs-* variables.
  • Tailwind: utility classes, mobile-first prefixes, needs a build step in production.
  • Know the plain CSS behind every class.
➡️ Next

Day 19 – Mini project: a fully responsive coaching-institute landing page from scratch, explained section by section.

Frequently Asked Questions

Will frameworks make plain CSS useless?
No – every framework class is plain CSS underneath. Debugging, customising and interviews all need real CSS knowledge.
Can I mix Bootstrap and my own CSS?
Yes. Link your stylesheet after Bootstrap and use your own BEM classes for custom components.
← CSS (20 Days)
🔗

Share this topic with a friend

यह topic किसी दोस्त को भेजें

Found it useful? Send it to a classmate learning the same thing.

अच्छा लगा? जो दोस्त यही सीख रहा है, उसे भेज दीजिए।

Next topicDay 19: Mini Project: Responsive Coaching Landing Page Your progress: 18 / 20 (90%) · Lesson 19 / 20 Continue →

How was this lesson?

Your feedback helps us make the content better.

Write a review or suggestion (optional)

After approval, your name and city may appear publicly with your review. Please do not write your email or phone number.

▶ CodingEasily on YouTube

Learn with video lessons in easy Hindi

Featured video: RDBMS Part 3 – Class XI Commerce IT

▶ Subscribe – it’s free