
This is the second row with three equal columns. This is the first row with three equal columns This is the second row with three equal columns
#BOOTSTRAP GRIDS TUTORIAL CODE#
The below code creates a row with two columns of equal width. Here, the col is the column, md define the breakpoint being medium and 6 is the number of grid columns it is taking up.

This content will sit inside a container with class. So we have a paragraph and a heading to it. For devices smaller than that the contents will be stacked on top of each other. Now, the content will be placed two per row for medium and larger sized devices. To create a two column layout, first, we define a row inside a container. All the other breakpoints just jumped up a class. So the class xs is, for now, devices with a screen size of less than 576 pixels. So effectively, Bootstrap has not added an extra class for extra large desktop but a breakpoint for extra small devices. So from now on the breakpoint for large desktops will be xl. Apart from improving and stabilizing some grid behaviours, new classes also have been added.īootstrap 4 introduces a new breakpoint class, xl. this is because the viewports are measured in pixels and are not affected by the font size.īootstrap 4 has brought a lot of changes in the grid systems from Bootstrap 3 as well. Note: Although the primary CSS units in Bootstrap 4 has changed to em and rem, pixels are used in the container widths snd breakpoints. So if a device's screen size is more than a particular breakpoint the layout of the web page changes to that is most appropriate to give the best user experience. These breakpoints are measured in terms of pixels. It has introduced another break point class to include extra small devices, and flexbox, making it easier to create grids of equal height and width.īreakpoints are the device viewport width from which point you want your layout to change. Bootstrap 4 has brought some significant changes to the grid system. In Bootstrap 2 the grid system was fixed by default. Since Bootstrap 3, the grid system became responsive. So the ideal case is a website that changes its layout automatically that suits best for the device it is viewed on.īootstrap grid system helps create a responsive layout very easily and quickly with Bootstrap's responsive grid classes. So, if a page takes up a certain layout for a desktop, it may create a bad user experience in a mobile because it may require the user to zoom in and out or scroll sideways and back, and vice versa. The grid system that we use for one device would not be ideal for another with a different screen size. Like in a page you can create a sidebar that takes up 4 columns and the rest of the 8 columns is used for some content like a blog, a picture gallery or a dashboard. You can mix and match and create columns that have different widths. It's not necessary that we use only grids of equal width. It just takes a little bit of arithmetic. So you will be taking up 4 grids for each of your content. So, you have 12 grids of a page and you want to divide it into three. You want a layout in which your content, let's say, for example, takes three columns in a row.


Simply put, you have 12 columns that make up your page. Similarly, if you want a 3 column layout for your page you can use 4 grid columns for your content. Say, for example, if you want a layout of content that takes up half of the viewport each, then you can use 6 grid columns for each of the content. The reason we use a 12 column grid is that 12 is divisible by many numbers. Each column has a small space in between them, they are called gutters. You can think of the viewport of a device made up of 12 columns and we arrange our contents in these 12 columns. Bootstrap uses a 12 column grid system to create the layout of a website. Let's begin with understanding what the Bootstrap grid system is. It allows the designers and developers to arrange the content in a layout that are well suited for devices as we scale up or down the size of the viewports Grids are unavoidable when it comes to creating a responsive web design.

Much like those used in the print media to improve the readablity for the users. They help in arranging the content of a website in a modular way. When designing a web page, designers and developers highly depend on the Grid System.They are used to create different layouts for a web page.
