DEV Community

Mian Azan
Mian Azan

Posted on

Bootstrap 3 and Bootstrap 4

In this article, we'll compare and contrast Bootstrap 3 and Bootstrap 4 versions of the framework.

What is Bootstrap

Bootstrap is the most widely used HTML, CSS, and JavaScript framework for creating mobile-friendly and responsive websites. It's a front-end framework that makes web development easier and faster. Bootstrap is available for download and use for free. A responsive website is one that can change itself to look well on all devices, including smartphones and desktop computers.

What is Bootstrap 3?

Bootstrap 3 is the latest version of the bootstrap framework. It is available for download and use at no cost. Similar to cascading style sheets, Bootstrap 3 is used to add design to HTML texts. It encourages the use of mobile-first design.
The Bootstrap 3 grid system contains four tiers: xs, sm, md, and lg, but the Bootstrap 4 grid system has five. In Bootstrap 3, the CSS unit is px. The class.img-responsive is used to create responsive pictures in this case, but this feature was altered in Bootstrap 4. Dark or reversed tables are not supported in Bootstrap 3, however they are supported in Bootstrap 4.

What is Bootstrap 4?

Bootstrap 4 is the most recent and up-to-date version of the Bootstrap framework. It features five different grid systems: xs, sm, md, lg, and xl. Many changes have been made, such as the CSS unit in Bootstrap 4 being rem, and.img-fluid being used to create responsive images. The.table-dark class in Bootstrap 4 allows users to build dark or reversed tables.

Now, let's see the comparison chart between Bootstrap 3 and Bootstrap 4. We are comparing both terms on the basis of some characteristics.

1.Grid system:

Bootstrap 3 has 4 tier grid system that includes xs, sm, md, and lg.

Bootstrap 4 has 5 tier grid system that includes xs, sm, md, lg, and xl.

2.CSS unit:

CSS unit in Bootstrap 3 is px.

CSS unit in Bootstrap 4 is rem.

3.Font size:

The font size is 14 px in Bootstrap 3.

Whereas, the font size is 16 px in Bootstrap 4.

4.Responsive images:

The .img-responsive class is used for creating the responsive images in it.
The .img-fluid class is used for creating the responsive images in it.

5.Glyphicons:

It supports Glyphicons.
It does not support Glyphicons.

6. Dark/inverse tables:

It does not support dark/inverse tables.

In Bootstrap 4, the .table-dark class is used to create dark/inverse tables.

7.CSS source file :

LESS (Leaner Style Sheets).
SCSS (Sassy CSS).

8.Pager classes:

In Bootstrap 3, pages can be aligned by using .previous class and .next class.

In Bootstrap 4, .previous class and .next class are not supported.

9. Dividers:

In Bootstrap 3, to divide sections, the .divider class is used in the li element.

In Bootstrap 4, to divide sections, the .dropdown-divider can be used in the div element.

10.Full width jumbotron:

In Bootstrap 3, the .jumbotron-fluid class cannot be used to create full width jumbotrons. Bootstrap 4 gives access to the user to use the .jumbotron-fluid class to create full width jumbotrons.

11.Form control size:

In Bootstrap 3, form size can be increased or decreased with the help of using .input-lg and .input-sm classes.
In Bootstrap 4, form size can be increased or decreased with the help of using .form-control-lg and .form-control-sm classes.

12.Help text:

In Bootstrap 3, we can use the .help-block class to display the help text.
Whereas in Bootstrap 4, we can use the .form-text class to display the help text.

13.Menu Headers:

In Bootstrap3, menu headers can be created by using the .dropdown-header class to the

<li>
Enter fullscreen mode Exit fullscreen mode

tag.

In Bootstrap 4, menu headers can be created by using the .dropdown-header class to the

<h1>, <h2> 
Enter fullscreen mode Exit fullscreen mode

tags.

14.Inline navs:

There is no .nav-inline class is included in Bootstrap 3.
There is a use of .nav-inline class in Bootstrap 4 to display the navs inline.

15.Dropdown structure:

In Bootstrap 3, the dropdown structure is created using

<ul> and <li>.
Enter fullscreen mode Exit fullscreen mode

In Bootstrap 4, the dropdown structure is created using

<ul> and <div>.
Enter fullscreen mode Exit fullscreen mode

16.Well, panels, and Thumbnails:

In Bootstrap 3, wells, panels, and thumbnails are supported.

In Bootstrap 4, wells, panels, and thumbnails are not supported. In place of that, cards can be used.

17.Carousel items:

In Bootstrap 3, the class .items is used to create carousel items. In Bootstrap 4, the class .carousel-items is used for carousel items.

18.Fixed navbars:

In Bootstrap 3, the navbar is fixed to top or bottom using the .navbar-fixed-top and .navbar-fixed-bottom class.

In Bootstrap 4, the navbar is fixed to top or bottom by using the .fixed-top and .fixed-bottom classes.

19.Navbars colors:

In Bootstrap 3, there is a limited color options. It supports inverse navbars. It does not support other classes.

In Bootstrap 4, there are new color options. It introduced the .navbar-light, .navbar-dark classes. It also allows the .bg-* classes to be used on navbars.

20.Extra small size button:

A button of extra small size can be created with the help of .btn-xs class.
The button of extra small size was no longer available in Bootstrap 4. The only available classes are .btn-sm and .btn-lg.

21.Outline buttons:

Outline buttons are not supported in Bootstrap 3.

Bootstrap 4 introduced the .btn-outline-* class to style buttons with an outline color.

22.Button styles:

It includes the .btn-default and .btn-info classes.
It includes the .btn-secondary, .btn-light and .btn-dark classes.

23. Button size:

A button of extra small size can be created with the help of .btn-xs class.
The button of extra small size is no longer available in Bootstrap 4. The only available classes are .btn-sm and .btn-lg.

24.Offsetting columns:

In Bootstrap 3, there is a use of col--offset- classes to offset the columns. As an instance, col-md-offset-4.

Whereas, in Bootstrap 4, there is a use of offset-- classes to offset the columns. As an instance, offset-md-4.

25.Checkbox and radio buttons:

In Bootstrap 3, the checkboxes or radio boxes were created with the help of classes such as .radio, .radio-inline, .checkbox, and .checkbox-inline.
In Bootstrap 4, the checkboxes and radio buttons are created with the help of using classes such as .form-check, .form-check-label, .form-check-input, and .form-check-inline.

26.Media objects:

In Bootstrap 3, there are various classes used for media objects such as .media, .media-body, .media-object, .media-heading, .media-list, and so on.
In Bootstrap 4, there is only one class used for media objects which is .media.

27.Table header:

It does not support table header.

In Bootstrap 4, table header modifier classes such as .thread-default, and .thread-inverse are added.

The above comparison fact shows that the latest version of Bootstrap has a number of enhancements. So far, we've looked at the differences between two versions of Bootstrap: Bootstrap 3 and Bootstrap 4. This article isn't the only place where you can compare Bootstrap 3 to Bootstrap 4. It's preferable to go to Bootstrap's official website to learn more.
So that concludes the article. I hope you find this essay instructive and useful in improving your user experience and development abilities.😅

Latest comments (0)