The Wayback Machine - https://web.archive.org/web/20240714092845/https://www.geeksforgeeks.org/explain-difference-between-bootstrap-and-foundation-frameworks-in-css/
Open In App

Explain difference between Bootstrap and Foundation frameworks in CSS

Last Updated : 30 Nov, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

In this article, we will know about the Foundation & Bootstrap frameworks in CSS, and will also understand their implementation through the example along with discussing the major differences between them.

Foundation 6: A Foundation is an open-source & responsive front-end framework built by ZURB in September 2011, that makes it easy to design beautiful responsive websites, apps, and emails that look amazing & can be accessible to any device. It is used by many companies such as Facebook, eBay, Mozilla, Adobe, and even Disney. The framework is built on Saas-like bootstrap. It is more sophisticated, flexible, and easily customizable. It also comes with CLI, so it’s easy to use it with module bundlers. It offers the Fastclick.js tool for faster rendering on mobile devices.  

A Foundation has a slightly more advanced interface compared to other framings. The responsive menu is one of its important properties. The menu is inconceivable when it comes to functionality and can also be freely baptized using CSS. This responsive architecture allows contrivers to beget elegant websites with added of a design-it-yourself approach.

Syntax:

<section class="callout large primary">
    <h1>Hello Geeks</h1>
</section>

Features:

  • Includes XY grids: The default grid system in Foundation allows the developer to control the layouts based on both horizontal and vertical positions.
  • Smooth scrolling note: This feature contains built-in JavaScript code, in order to add the “smooth scroll” property to a specific or any link present inside the webpage.
  • Easier prototyping: It facilitates built-in functionality that helps to speed up the prototyping process.

Note:

  • The Foundation’s grid uses box-sizing: border-box property to apply gutters to columns, but this property & along with the ES5 features is not supported by the Internet Explorer v8.
  • The browsers will not support media queries properties for displaying the mobile styles of the site.

Example: This example illustrates the use of the CSS Foundation’s classes for making the blogging webpage.

HTML




<!DOCTYPE html>
<html class="no-js" lang="en">
 
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content=
        "width=device-width, initial-scale=1.0" />
 
    <link rel="stylesheet" href=
</head>
 
<body>
 
    <!-- Start Top Bar -->
    <div class="top-bar">
        <div class="top-bar-left">
            <ul class="menu">
                <li class="menu-text">Blog Post</li>
            </ul>
        </div>
    </div>
    <!-- End Top Bar -->
 
    <div class="callout small primary">
        <div class="row column text-center">
            <h2>GeeksforGeeks Blogs</h2>
        </div>
    </div>
 
    <div class="row" id="content">
        <div class="medium-8 columns">
            <div class="blog-post">
                <h3>Java blog <small>3/6/2021</small></h3>
 
                 
<p>
                    Java syntax is similar to C/C++. But
                    Java does not provide low level
                    programming functionalities like
                    pointers. Java is one of the most
                    popular and widely used programming
                    language and platform. A platform
                    is an environment that helps to
                    develop and run programs written
                    in any programming language.
                </p>
 
 
                <div class="callout">
                    <ul class="menu simple">
                        <li><a href="#">
                            Author: Mike Mikers
                        </a></li>
                        <li><a href="#">Comments: 3</a></li>
                    </ul>
                </div>
 
                <div class="blog-post">
                    <h3>Python blog <small>18/8/2021</small></h3>
 
                     
<p>
                        Python is a high-level, general-purpose
                        and a very popular programming language.
                        Python programming language (latest Python
                        3) is being used in web development,
                        Machine Learning applications, along with
                        all cutting edge technology in Software
                        Industry.
                    </p>
 
 
                    <div class="callout">
                        <ul class="menu simple">
                            <li><a href="#">Author: Mike Mikers</a></li>
                            <li><a href="#">Comments: 10</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
 
        <script src=
        </script>
        <script src=
        </script>
         
        <script>
            $(document).foundation();
        </script>
    </div>
</body>
 
</html>


Output:

Customization menu of Foundation: There are several ways to customize the menu using Foundation such as the Basic menu, alignment menu, vertical menu, simple menu, nested menu, etc, for proving the flexibility along with making it an all-purpose navigation component. 

Example: This example illustrates the CSS Foundation to make use of the customize column for the menu.

HTML




<!DOCTYPE html>
<html class="no-js" lang="en">
 
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,
                   initial-scale=1.0" />
 
    <link rel="stylesheet" href=
</head>
 
<body>
    <style>
        .row {
            padding: 1rem 0;
        }
 
        .singleline {
            padding-right: 1rem;
        }
    </style>
    <div class="row">
        <h2>Customize Menu using Foundation</h2>
 
        <!--Basic Menu-->
        <div class="columns">
            <h4>Basic Menu</h4>
        </div>
    </div>
    <div class="row">
        <div class="columns">
            <ul class="menu">
                <li><a href="#">
                    Programming Language
                </a></li>
                <li><a href="#">Articles</a></li>
                <li><a href="#">Blogs</a></li>
                <li><a href="#">DSA</a></li>
            </ul>
        </div>
    </div>
 
    <!--Alignment Menu-->
    <div class="row">
        <div class="columns">
            <h4>Alignment Menu</h4>
            <ul class="menu align-right">
                <li><a href="#">
                    Programming Language
                </a></li>
                <li><a href="#">Articles</a></li>
                <li><a href="#">Blogs</a></li>
                <li><a href="#">DSA</a></li>
            </ul>
            <div>
                <ul class="menu expanded">
                    <li><a href="#">Articles</a></li>
                </ul>
                <ul class="menu expanded">
                    <li><a href="#">Blogs</a></li>
                    <li><a href="#">DSA</a></li>
                </ul>
                <ul class="menu expanded">
                    <li><a href="#">
                        Programming Language
                    </a></li>
                    <li><a href="#">Blogs</a></li>
                    <li><a href="#">DSA</a></li>
                </ul>
                <ul class="menu expanded">
                    <li><a href="#">
                        Programming Language
                    </a></li>
                    <li><a href="#">Articles</a></li>
                    <li><a href="#">Blogs</a></li>
                    <li><a href="#">DSA</a></li>
                </ul>
            </div>
        </div>
    </div>
 
    <!--Vertical Menu-->
    <div class="row">
        <div class="column">
            <h4>Vertical Menu</h4>
            <ul class="vertical menu">
                <li><a href="#">
                    Programming Language
                </a></li>
                <li><a href="#">Articles</a></li>
                <li><a href="#">Blogs</a></li>
                <li><a href="#">DSA</a></li>
            </ul>
        </div>
    </div>
 
    <!--Simple Style-->
    <div class="row">
        <div class="column">
            <h4>Simple Style</h4>
            <ul class="menu simple">
                <li class="singleline">
                    <a href="#">DSA</a>
                </li>
                <li><a href="#">
                    Programming Language
                </a></li>
                <li><a href="#">Articles</a></li>
                <li><a href="#">Blogs</a></li>
            </ul>
        </div>
    </div>
 
    <!--Nested Style-->
    <div class="row">
        <div class="column">
            <h4>Nested Style</h4>
            <ul class="vertical menu">
                <li>
                    <a href="#">DSA</a>
                    <ul class="nested vertical menu">
                        <li><a href="#">Contribute</a></li>
                        <li><a href="#">
                            Programming Language
                        </a></li>
                        <li><a href="#">Articles</a></li>
                        <li><a href="#">Blogs</a></li>
                    </ul>
                </li>
                <li><a href="#">Programming Language</a></li>
                <li><a href="#">DSA</a></li>
                <li><a href="#">Blogs</a></li>
            </ul>
        </div>
    </div>
 
    </script>
    <script src=
    </script>
    <script>
        $(document).foundation();
    </script>
</body>
 
</html>


Output:

Pros:

  • Semantic: Everything is semantic. We can make the markup as neat & clean without sacrificing the utility and speed of the Foundation.
  • Mobile-First Design: The Foundation facilitates the building of applications for all-purpose devices. As the device size increase, the layers will be more complex for a completely responsive design.
  • Customizable: The Foundation provides the customizable option for building the apps that may contain including or removing certain elements, defining the size of columns, colors, font size, and more.

Cons:

  • Not recommended framework for beginners at the initial level.
  • Less popular than Bootstrap.

Bootstrap 5:

A Bootstrap is a free and open-source collection of CSS and JavaScript/jQuery code used for creating dynamic websites layout and web applications. It was designed by former Twitter retainers Mark Toto and Jacob Thornton. 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 make responsive websites. Bootstrap 5 was officially released on 16 June 2020 after several months of redefining its features. It is used by many companies such as Vogue, Indeed, Walmart, Code Academy and more.

Syntax:

<section class="bts">
   <h1 class="bg-success">Hello Geeks</h1>
</section>

Example: This example illustrates the simple use of the Bootstrap framework for making the pill navigation menu.

HTML




<!DOCTYPE html>
<html lang="en">
 
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible"
        content="IE=edge" />
    <meta name="viewport" content=
        "width=device-width, initial-scale=1.0" />
 
    <link href=
        rel="stylesheet"
        integrity=
"sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
        crossorigin="anonymous" />
</head>
 
<body>
    <nav class="nav nav-pills p-4 bg-dark">
        <a class="nav-link active bg-warning"
            aria-current="true" href="#">Home
        </a>
        <a class="nav-link text-warning" href="#">
            About Us
        </a>
        <a class="nav-link text-warning" href="#">
            Careers
        </a>
        <a class="nav-link text-warning" href="#">
            Contact Us
        </a>
    </nav>
    <p class="p-4">
        GeeksforGeeks - A Computer Science
        portal for geeks. It contains well
        written, well thought and well
        explained computer science and programming
        articles, quizzes and practice/
        competitive programming/company interview
        Questions.
    </p>
 
</body>
 
</html>


Output:

Bootstrap Pills Menu

Pros:

  • Preprocessors: Bootstrap has vanilla CSS, although utilize the 2 popular CSS preprocessors, LESS & SASS in its source code.
  • Every device, One framework: Bootstrap facilitates easy & efficient way to scales the websites or apps with a single code base, with CSS media queries.
  • Full of features: Bootstrap facilitates the  extensive & complete documentation for the HTML elements, that are commonly used, along with lots of custom HTML and CSS components, and the jQuery plugins, & many more.

Cons:

  • Similar look pattern for every website.
  • Bit heavier to load the website.

Difference between Bootstrap 5 and Foundation 6:                           

S.No.

Bootstrap 5

Foundation 6

1.

Bootstrap supports the SASS properties but it is actually built using LESS, which implies the Bootstrap uses both LESS & SASS.

Foundation contains its specific CLI i.e. it only implements the SASS property.

2.

Despite of having 12-column grid system, which is the featured of both the frameworks, Bootstrap contains the fixed-width grid layout.

Foundation contain a fluid layout. In other words, it contains a more flexible grid system.

3.

The integration of the Bootstrap class names to various HTML elements such as form elements, images, etc., is must that will ensures the responsiveness and to display base CSS styles.

Base CSS of Foundation framework is “out of the box.”

4.

Bootstrap comprehends 12 JavaScript plugins.

Foundation framework hold 16 JS plugins

5.

Bootstrap has a reboot.css.

Foundation has normalize.css

6.

It permits inline forms.

It doesn’t permit inline forms.

7. Bootstrap allows the creation of a simple & easy with elegant website having a very little knowledge of CSS and JavaScript. Foundation facilitates slightly more complex feature ie., Do it yourself approach that will help to create more unique and custom designs.


Similar Reads

Difference between bootstrap.css and bootstrap-theme.css
Bootstrap is an HTML, CSS and JS front-end-framework used for developing responsive and mobile-first projects on the web. It is the framework that comes up with predefined terms, thus giving you the ability to use these codes instead of having to create the codes from scratch. It is a collection of HTML, CSS and JS code that is designed to help bui
5 min read
Difference Between Express and Fastify Web App Frameworks
While building backend applications with Node JS there is a list of frameworks that can be used with Node JS. Two of the most popular choices are Express.js and Fastify. In this article, we will learn about these frameworks and their difference. Table of Content What is Express JS?Features of Express JS frameworkWhat is Fastify?Features of Fastify
3 min read
Boost Your Web Design Skills with Powerful CSS Frameworks
CSS frameworks are collections of pre-written CSS code that provide a set of rules and conventions for developers to follow when styling their web projects. These frameworks are designed to save developers time and effort by providing pre-built styles for commonly used design elements such as buttons, forms, typography, and grids. They can help ens
7 min read
6 Best CSS frameworks You should Know to design Attractive Websites
If you want to speed up your website and development process, or want to add some classy designs to your website, then you're at the right place. Awesome new popups, speed, ultimate colors and themes are waiting for you. Front end development is the complete pack of creation and colors and have amazing frameworks. Every framework has its own unique
3 min read
10 Best CSS Frameworks for Frontend Developers in 2024
" NASA has landed robots on Mars, and some developers are still struggling with the center alignments of the divs in their website"  This joke has a lot of truth in it. Making a beautiful website that looks good on every browser is not an easy thing for web developers mainly frontend developers. Developers have to consider all the web browsers and
10 min read
CSS Frameworks
CSS frameworks are pre-prepared libraries containing styles and templates that standardize and streamline the design and development process. They enhance the efficiency of styling web pages, allowing developers to expedite their workflow. CSS frameworks tackle the challenge of responsive design, seamlessly adapting layouts to diverse screen sizes.
7 min read
Difference Between Bootstrap 3 and Bootstrap 4
Bootstrap: Bootstrap was developed by Mark Otto and Jacob Thorton at Twitter in August 2011. It is an open-source framework that is used to design responsive websites faster and easier. It is the most popular open-source framework that includes HTML, CSS, and JavaScript. It can create web applications with any server-side Technology like Java, PHP,
2 min read
Difference between Bootstrap 4 and Bootstrap 5
What is Bootstrap? It is an open-source framework from late 2011 that is used for designing responsive websites with a mobile-first approach faster and easier. Bootstrap is available for HTML, CSS, and JS. According to server-side languages like PHP, Node, etc. bootstrap helps to design the frontend. Bootstrap has made the work for developers easie
3 min read
What is media object and explain there types in Bootstrap ?
In this article, we will learn about the Bootstrap media object, which is helpful to place the media alongside the text. Also, we will understand the various ways to use the media with text &amp; its implementation through the examples. Media objects are the bootstrap component that helps to build repetitive design in Bootstrap where some media is
6 min read
Explain the Typography and links in Bootstrap?
In this article, we will see the Typography &amp; the Links In Bootstrap, along with understanding their basic implementation through the examples. Bootstrap Typography facilitates the different styling and formatting of text content, along with providing customization which includes customized headings, inline subheadings, lists, and paragraphs, a
2 min read
three90RightbarBannerImg