Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • BS5 Tutorial
  • BS5 Interview Questions
  • BS5 Layout
  • BS5 Content
  • BS5 Components
  • BS5 Helpers
  • BS5 Utilities
  • BS4 Tutorial
  • BS Tutorial
  • Bootstrap Cheatsheet
  • Tailwind
  • CSS Frameworks
  • HTML Formatter
Open In App
Next Article:
Bootstrap 5 Tutorial
Next article icon

Bootstrap Tutorial

Last Updated : 03 Jun, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

Bootstrap is a popular front-end framework for building responsive and mobile-first websites. It provides pre-designed CSS, JavaScript components, and utility classes to quickly create modern and consistent user interfaces.

  • It Includes pre-built responsive grid systems for mobile-first design.
  • Offers a wide range of UI components like buttons, modals, and navbars.
  • Provides built-in support for responsive typography, spacing, and utilities.
  • Extensively customizable via Sass variables and Bootstrap's configuration.

To start with Bootstrap, you need to install it on your project or use the CDN link. Follow these articles to install depending on your system:

  • How to install Bootstrap 5?
  • How to Add Bootstrap in a Project?

Let us now take a look at our first code example.

HTML
<html>  <head>     <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"      rel="stylesheet"         integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"         crossorigin="anonymous">     <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"         integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"         crossorigin="anonymous"></script> </head>  <body>     <div class="container text-center">         <h1 class="text-success">             Welcome to GeeksforGeeks         </h1>         <p class="text-dark">A Simple Example of Bootstrap</p>     </div> </body>  </html> 

Output

Bootstrap-Example-Output
FIrst Bootstrap Example

In this example:

  • Bootstrap CSS and JavaScript files are included via CDNs with integrity attributes for security.
  • The container class ensures the content is responsive and aligned.
  • The text-center class centers the text within the div.
  • The text-success class adds a green color to the heading, using Bootstrap's built-in color utilities.

Why Learn Bootstrap?

  • Accelerates the development of modern web pages.
  • Ensures consistent design across devices and browsers.
  • Reduces the need for writing custom CSS.
  • Ideal for both beginners and professionals in web development.
Bootstrap-Tutorial
Bootstrap Tutorial

Bootstrap Layout

Bootstrap layout is built on a flexible grid layout that adjusts seamlessly to different screen sizes. It uses a 12-column grid system to create responsive designs. You can control the width and positioning of columns by combining classes for different screen sizes (e.g., .col-md-6 for medium devices).

  • Breakpoints
  • Containers
  • Grid
  • Columns
  • Gutters
  • Utilities
  • Z-index

Bootstrap Content

Bootstrap provides a range of classes to enhance and structure content. It includes typography classes for headings, paragraphs, and text alignment, as well as helper classes for spacing and text colors.

  • Reboot
  • Typography
  • Images
  • Tables
  • Figures

Bootstrap Forms

Bootstrap simplifies form creation with pre-styled components and layouts. It includes classes for form controls like text inputs, select menus, and checkboxes.

  • Forms
  • Form Controls
  • Select
  • Checks and Radios
  • Range
  • Input group
  • Floating labels
  • Form Layout
  • Form Grid
  • Horizontal Form
  • Validation

Bootstrap Components

Bootstrap offers a rich set of pre-designed components to streamline UI development. These include buttons, cards, modals, navbars, and more.

  • Accordion
  • Alerts
  • Badges
  • Breadcrumb
  • Buttons
  • Button Group
  • Card
  • Carousel
  • Close Button
  • Collapse
  • Dropdowns
  • List Group
  • Modal
  • Navbar
  • Offcanvas
  • Popovers
  • Pagination
  • Progress
  • Scrollspy
  • Spinners
  • Toasts
  • Tooltips

Bootstrap Helpers

Bootstrap helpers are utility classes that simplify common tasks and improve readability. They include classes for text alignment, visibility, display properties, and more.

  • Clearfix
  • Colored links
  • Ratios
  • Position
  • Visually Hidden
  • Stretched link
  • Text truncation

Bootstrap Utilities

Bootstrap utilities are small, reusable classes that provide additional functionality and control. They include classes for spacing, alignment, borders, and background colors.

  • Background
  • Borders
  • Colors
  • Display
  • Flex
  • Float
  • Interactions
  • Overflow
  • Position
  • Shadows
  • Sizing
  • Spacing
  • Text
  • Vertical align
  • Visibility

Bootstrap For Interview

  • Bootstrap Interview Questions And Answers
  • Bootstrap Exercises, Practice Questions and Solutions
  • Bootstrap Quiz | Set-1
  • Bootstrap Quiz | Set-2
  • Bootstrap Quiz | Set-3

Features of Bootstrap

  • Grid System: Easily create responsive layouts with a flexible grid system that adjusts seamlessly to various screen sizes.
  • Forms: Build user-friendly forms with diverse styles and functionalities, including validation.
  • Buttons: Add customizable buttons of all shapes and sizes to enhance your website's interactivity.
  • Navigation: Implement intuitive navigation menus, from simple dropdowns to advanced mega menus.
  • Alerts: Effectively communicate with dismissible alerts, warnings, and success notifications.
  • Images: Improve your website's visual appeal with responsive image handling.
  • JavaScript Plugins: Integrate interactive features like modals, tooltips, and carousels using Bootstrap’s JavaScript plugins.

Applications of Bootstrap

  • Creating Responsive Websites
  • Prototyping Web Applications
  • Developing Admin Dashboards
  • Building Landing Pages
  • Designing E-commerce Frontends

Bootstrap vs Other CSS Frameworks

FeatureBootstrapTailwind CSSFoundation
Design PhilosophyPre-designed ComponentsUtility-firstPre-designed Components
Learning CurveEasyModerateModerate
CustomizationModerateHighModerate
ResponsivenessBuilt-inBuilt-inBuilt-in
Use CaseQuick PrototypesTailored DesignsEnterprise Websites

Best Approach to Learn Bootstrap

You can complete this Bootstrap tutorial in approximately 8 weeks.


Next Article
Bootstrap 5 Tutorial

D

dharmendra_kumar
Improve
Article Tags :
  • Web Technologies
  • Bootstrap
  • Tutorials
  • Web-Tech Tutorials

Similar Reads

    Bootstrap Tutorial
    Bootstrap is a popular front-end framework for building responsive and mobile-first websites. It provides pre-designed CSS, JavaScript components, and utility classes to quickly create modern and consistent user interfaces.It Includes pre-built responsive grid systems for mobile-first design.Offers
    4 min read
    Bootstrap 5 Tutorial
    Bootstrap 5 is a front-end framework that helps developers create responsive and visually appealing websites quickly and efficiently. Bootstrap 5 simplifies the process of web development with its intuitive design system and extensive components. This version includes improved responsiveness, stream
    6 min read
    Bootstrap 4 Tutorial
    Bootstrap 4 is an open-source framework for creating responsive web applications. It is the most popular CSS framework for creating mobile-first websites. It is free to use we can directly integrate Bootstrap 4 into our project using CDN Links or with npm. Bootstrap 4 Tutorial is designed to help be
    3 min read

    Bootstrap 5

    Bootstrap 5 Introduction
    Bootstrap is a free and open-source collection of CSS and JavaScript/jQuery code used for creating dynamic websites layout and web applications. Bootstrap is one of the most popular front-end frameworks which has really a nice set of predefined CSS codes. Bootstrap uses different types of classes to
    4 min read
    Bootstrap 5 Progress
    Bootstrap 5 is the latest major release by Bootstrap in which they have revamped the UI and made various changes. A progress bar is used to display the progress of a process on a computer. A progress bar displays how much of the process is completed and how much is left. You can add a progress bar o
    5 min read
    Bootstrap 5 Buttons
    Bootstrap 5 Buttons are pre-styled components in the Bootstrap framework, offering consistent design and functionality. They streamline development by providing ready-to-use button styles, sizes, and behaviors, ensuring a cohesive and responsive user interface across web applications with minimal CS
    3 min read
    Bootstrap 5 Badges
    Bootstrap 5 Badges are small components used to highlight specific information, typically in lists or inline with other content. They provide visual cues through colored backgrounds and customizable text, helping to draw attention to key details or status indicators within a webpage or application.
    2 min read
    Bootstrap 5 Alerts
    Bootstrap 5 Alerts are customizable components used to convey important information to users. They come in various styles such as success, warning, danger, and info, providing visual feedback to users based on different actions or states within a web application. iframe { width: 100%; height: 450px;
    2 min read
    Bootstrap 5 Modal
    Bootstrap 5 is the latest major release by Bootstrap in which they have revamped the UI and made various changes. Modals are used to add dialogs to your site for lightboxes, user notifications, or completely custom content. Modals are built with HTML, CSS, and JavaScript. They’re positioned over eve
    7 min read

    Bootstrap 4

    Bootstrap 4 Introduction
    Bootstrap is a free and open-source tool collection for creating responsive websites and web applications. It is the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites. It solves many problems which we had once, one of which is the cross-browser compati
    3 min read
    Bootstrap 4 | Grid System
    Bootstrap Grid System allows up to 12 columns across the page. You can use each of them individually or merge them together for wider columns. All combinations of values summing up to 12 can be used. Grid Classes: Bootstrap grid system contains five classes which are listed below: .col- It is used f
    3 min read
    Bootstrap 4 | Typography
    Typography is a feature of Bootstrap for styling and formatting the text content. It is used to create customized headings, inline subheadings, lists, paragraphs, aligning, adding more design-oriented font styles, and much more. Bootstrap support global settings for the font stack, Headings and Link
    3 min read
    Bootstrap 4 | Colors
    Text Colors: Bootstrap provides many classes to set the text color of an element. All classes of text colors are listed below: Example: This example uses text color class to set the color of text content. html <!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap
    2 min read
    Bootstrap 4 | Tables
    Bootstrap provides a series of classes that can be used to apply various styling to the tables such as changing the heading appearance, making the rows stripped, adding or removing borders, making rows hoverable, etc. Bootstrap also provides classes for making tables responsive. Simple Table: The .t
    9 min read
    Bootstrap 4 Images
    Bootstrap 4 provides classes to style images responsively, including responsive images that automatically adjust the size based on screen width, image shapes such as rounded or circular, and image thumbnails with optional borders and captions, facilitating flexible and attractive image layouts. The
    4 min read

    Bootstrap Questions

    How to design Bootstrap Fullscreen Select feature for Mobiles ?
    In this article, we will learn how to design Bootstrap fullscreen select feature for mobile devices.It provides advanced HTML full screen select functionality.It provides in and out animations.It provides open and close events function callbacks.It provides CSS3 animated buttons, dropdowns and texts
    3 min read
    How to use Top Navigation with Left Navigation Bar using Bootstrap?
    Using Top Navigation with Left Navigation Bar in Bootstrap means creating a layout with a responsive top navigation bar (typically for global site navigation) and a left sidebar for additional links or menus. This combines Bootstrap’s grid system, navbar classes, and custom CSS for layout management
    4 min read
    How to put two columns one below other in sidebar in Bootstrap?
    To place two columns one below the other in a sidebar using Bootstrap, you can use Bootstrap's grid system. By setting up a vertical stacking of columns within a sidebar container, you ensure that the columns appear one below the other. This is achieved by using a single column width and placing the
    5 min read
    How to always show first two rows in dynamic collapse using Bootstrap ?
    Bootstrap is an open-source front-end CSS framework used widely for the development of interactive websites. Bootstrap with HTML and JavaScript adds interactivity to the user interface. jQuery is a JS library used for the manipulation of HTML DOM, event handling, CSS animations, and Ajax. jQuery is
    6 min read
    How to add a black hover to an image using bootstrap?
    Bootstrap is a popular CSS framework widely used by frontend developers to create interactive UI for web applications. Bootstrap is widely used because of its simplicity and ease to use. Bootstrap allows multiple utilities to make images interactive. One of these utilities can be changing the color
    4 min read
    How to create full width container using bootstrap?
    Bootstrap offers two types of containers: fixed-width containers and full-width, fluid containers. The container-fluid class is used to create a full-width container that spans the entire width of the viewport, adjusting dynamically as the viewport size changes.Container Types in BootstrapFixed-Widt
    3 min read
    How to fit the image into modal popup using Bootstrap?
    Modal plugin allows us to add a dialog popup window that is displayed on top of the current page. Bootstrap provides an easy, yet effective way to incorporate modal into our web pages. Modal can consist of any content along with a header and footer.Images can be fitted in modal popup using Bootstrap
    2 min read
    Bootstrap Examples
    The following Bootstrap section contains a wide collection of Bootstrap examples. These examples are categorized based on the topics including basics, directives, functions, and many more. Each example may contain multiple approaches to solve the problem. Table of Content CustomizeLayoutContentForms
    4 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences