Columns: 4 even width bootstrap columns

Creating 4 Even Width Bootstrap Columns

The Bootstrap Grid system enables you to layout page content in a way that will be responsive across screen sizes. Here is a demonstration of how you can use Bootstrap Grid coding to easily create 4 even width columns. In these examples, all columns are 1/4 of the page width (3 column spans).

First we demonstrate what the columns look like with a couple of paragraphs of lorem ipsum text. Next we show four variations of the HTML code you might use to create the columns. Next we show four examples of columns using these code variations. Observe the behavior as you resize the width of your browser to see the breakpoints at which the columns change from vertical to horizontal display and vice versa. Finally, we talk about the difference between the extra-small, small, medium and large coding of columns.

4 even width columns, shown with lorem ipsum text filler

Grid columns will stack vertically below their breakpoints. The following 4 column example uses sm (small) coding. The columns should display horizontally on large and medium desktops and on tablets. Columns should stack vertically on phones. You might agree that sm is the correct coding for these 4 columns because the presentation of content in 4 horizontal columns on desktops and tablets provides good user experience while stacking columns on phones avoids the problem of very narrow and very long columns. In the end, the content will dictate which of the four grid markup options is best in a particular situation (col-xs, col-sm, col-md, col-lg). To further observer the difference in the markup options, check out the green examples further down the page.


1 U wouldn't hit a man with no trousers on, would you? you see, in this world there's two kinds of people, my friend: those with loaded guns and those who dig. you dig. at this point, i'd set you up with a chimpanzee if it'd brought you back to the world!

4 even columns with bootstrap grid Rehabilitated? well, now let me see. you know, i don't have any idea what that means. bruce... i'm god. boxing is about respect. getting it for yourself, and taking it away from the other guy.

2 U wouldn't hit a man with no trousers on, would you? you see, in this world there's two kinds of people, my friend: those with loaded guns and those who dig. you dig. at this point, i'd set you up with a chimpanzee if it'd brought you back to the world!

4 even columns with bootstrap grid Rehabilitated? well, now let me see. you know, i don't have any idea what that means. bruce... i'm god. boxing is about respect. getting it for yourself, and taking it away from the other guy.

3 U wouldn't hit a man with no trousers on, would you? you see, in this world there's two kinds of people, my friend: those with loaded guns and those who dig. you dig. at this point, i'd set you up with a chimpanzee if it'd brought you back to the world!

4 even columns with bootstrap grid Rehabilitated? well, now let me see. you know, i don't have any idea what that means. bruce... i'm god. boxing is about respect. getting it for yourself, and taking it away from the other guy.

4 U wouldn't hit a man with no trousers on, would you? you see, in this world there's two kinds of people, my friend: those with loaded guns and those who dig. you dig. at this point, i'd set you up with a chimpanzee if it'd brought you back to the world!

4 even columns with bootstrap grid Rehabilitated? well, now let me see. you know, i don't have any idea what that means. bruce... i'm god. boxing is about respect. getting it for yourself, and taking it away from the other guy.

4 variations* of html used to create the 4 even width column examples (further down)

HTML for 4 even width columns extra-small (phones)

<div class="row">
  <div class="border col-xs-3">.col-xs-3</div>
  <div class="border col-xs-3">.col-xs-3</div>
  <div class="border col-xs-3">.col-xs-3</div>
  <div class="border col-xs-3">.col-xs-3</div>
</div>

HTML for 4 even width columns small (desktops)

<div class="border row">
  <div class="border col-sm-3">.col-sm-3</div>
  <div class="border col-sm-3">.col-sm-3</div>
  <div class="border col-sm-3">.col-sm-3</div>
  <div class="border col-sm-3">.col-sm-3</div>
</div>

HTML for 4 even width columns medium

<div class="border row">
  <div class="border col-md-3">.col-md-3</div>
  <div class="border col-md-3">.col-md-3</div>
  <div class="border col-md-3">.col-md-3</div>
  <div class="border col-md-3">.col-md-3</div>
</div>

HTML for 4 even width columns large

<div class="border row">
  <div class="border col-lg-3">.col-lg-3</div>
  <div class="border col-lg-3">.col-lg-3</div>
  <div class="border col-lg-3">.col-lg-3</div>
  <div class="border col-lg-3">.col-lg-3</div>
</div><!--.row-->

4 examples* of 4 even width columns (green background):

4 even width columns using extra-small (phones - less than 768px; Horizontal at all times)

.col-xs-3
.col-xs-3
.col-xs-3
.col-xs-3

4 even width columns using small (tablets - 768px and up; Collapsed to start, horizontal above breakpoints)

.col-sm-3
.col-sm-3
.col-sm-3
.col-sm-3

4 even width columns using medium (desktops - 992px and up; Collapsed to start, horizontal above breakpoints)

.col-md-3
.col-md-3
.col-md-3
.col-md-3

4 even width columns using large (large desktops - 1200px and up; Collapsed to start, horizontal above breakpoints)

.col-lg-3
.col-lg-3
.col-lg-3
.col-lg-3

*What's the difference between xs, sm, md, and lg coded columns?

Bootstrap includes a responsive, mobile first fluid grid system that appropriately scales up to 12 columns as the device or viewport size increases. To understand why and when to use which column coding type, compare pages coded in each way on a variety of screens: desktops, pads, and phones. On mobile, observe the effect on layout when viewing portrait or landscape mode. You'll see how each coding choice effects column break points - or horizontal column wrapping. You can see most of this behavior by slowly resizing the width of your browser on a desktop. You'll notice the large columns will wrap vertically first, followed by the medium, small and extra small as the browser window gets narrower.

Note that rows must be placed within .container (fixed-width) or .container-fluid (full-width) tags. In the Shoestrap theme, used on this site, these tags reside in the header and footer and not in the WordPress edit page screen. .row is used to create horizontal groups of columns.

Grid columns are created by specifying the number of twelve available columns you wish to span. For example, three equal columns would use three .col-xs-4 or .col-sm-4 or .col-md-4 or .col-lg-4 divs per row.

Read more about the Bootstrap Grid System here.