What is Bootstrap?
Bootstrap is a popular open-source front-end framework used for designing responsive and mobile-first websites and web applications. It provides ready-to-use HTML, CSS, and JavaScript components, such as buttons, forms, navigation bars, modals, and grids, which help developers build visually appealing and consistent user interfaces quickly.
One of the main features of Bootstrap is its grid system, which allows layouts to adjust automatically on different screen sizes, making websites responsive. It also includes pre-designed components and utility classes that save time, reduce the need for custom CSS, and ensure cross-browser compatibility.
Overall, Bootstrap is widely used because it speeds up development, maintains design consistency, and makes web applications responsive without extensive coding from scratch.
Why use Bootstrap?
Bootstrap is used because it makes web development faster, easier, and more consistent. It provides ready-to-use components like buttons, forms, navbars, modals, and tables, so developers don’t have to write CSS from scratch. Its responsive grid system allows websites to adjust automatically to different screen sizes, which is essential for mobile-first design. Bootstrap also ensures cross-browser compatibility, so the website looks good on all major browsers. Additionally, it includes utility classes and JavaScript plugins for tasks like sliders, popups, and navigation menus, saving time, reducing coding effort, and maintaining a professional and consistent look across the website.
Grid system
row) and columns (col) are used to structure content.col-6 for half width).col-sm → small devices (≥576px)col-md → medium devices (≥768px)col-lg → large devices (≥992px)col-xl → extra large devices (≥1200px)Container vs container-fluid
container
container-fluid
Tip to remember: container = fixed & centered, container-fluid = full width.
Breakpoints
xs (extra small): <576px – default for mobilesm (small): ≥576px – small devices like phonesmd (medium): ≥768px – tabletslg (large): ≥992px – laptops/desktopsxl (extra large): ≥1200px – large desktopscol-sm, col-md, col-lg, and col-xl are used to apply styles at specific breakpoints.Tip to remember: Start styling from mobile-first and expand layouts for bigger screens.
Responsive utilities
Responsive utilities are classes in Bootstrap used to show, hide, or adjust content based on screen size.
Examples:
d-none → hides an elementd-sm-block → shows element on small screens and aboved-md-inline → shows element as inline on medium screens and aboveThey help control visibility and layout for different devices
Tip to remember: Use d- classes to easily show or hide elements per device
Bootstrap vs CSS
Bootstrap is a front-end framework with ready-to-use CSS, JavaScript, and components for faster development.
CSS (Cascading Style Sheets) is a style sheet language used to design and style HTML elements from scratch.
Bootstrap provides predefined classes, grid system, responsive utilities, and components; CSS requires manual coding for layouts and styles.
Bootstrap is faster and easier for building responsive websites; CSS gives full control and customization.
Tip to remember: Bootstrap = ready-made & fast, CSS = custom & flexible
Bootstrap vs Tailwind
Bootstrap is a component-based front-end framework with predefined UI components, grid system, and JavaScript plugins.
Tailwind CSS is a utility-first CSS framework that provides small utility classes to style elements directly without predefined components.
Bootstrap is faster to build standard layouts but less flexible for custom designs.
Tailwind allows more customization and unique designs but requires writing more classes per element.
Tip to remember: Bootstrap = ready components, Tailwind = full control with utilities
Bootstrap vs Material UI
Bootstrap is a front-end framework providing predefined components, grid system, and utilities for responsive websites.
Material UI (MUI) is a React-based component library that implements Google’s Material Design with ready-to-use React components.
Bootstrap works with any front-end setup, while Material UI is specifically for React applications.
Bootstrap is faster for general layouts, MUI offers modern, customizable UI with React integration.
Tip to remember: Bootstrap = general-purpose responsive framework, Material UI = React + Material Design components
What is flex utility?
Flex utility in Bootstrap uses Flexbox classes to create flexible and responsive layouts.
Common classes:
d-flex → makes an element a flex containerjustify-content-center → centers items horizontallyalign-items-center → centers items verticallyflex-row / flex-column → arranges items in row or columnHelps align, order, and distribute space among items easily without custom CSS
Tip to remember: Use d-flex and alignment classes to quickly control layout and positioning
What is spacing utility?
m = margin, p = padding, followed by side (t=top, b=bottom, l=left, r=right, x=left & right, y=top & bottom, blank=all sides) and size (0-5).
mt-3 → margin-top 3, px-4 → padding-left & right 4Bootstrap navbar
Modals
Toasts
Cards
Forms
Bootstrap validation
Icons usage
Customizing Bootstrap
Bootstrap themes