Home / Blog / Code Snippets
,

How to create five equal columns in Bootstrap 3?

First published 26 Jul 2017. Checked again in November 2026: this CSS is for Bootstrap 3. Bootstrap 4.4 and later have five equal columns built in with the row-cols-5 class.

Bootstrap, the most used HTML, CSS and jQuery Framework used by most of the developers in the world. All components of Bootstrap are of great use for developing beautiful user-friendly websites. One of the great components of Bootstrap is its Grid structure. When using default 12-column grid, it sometimes creates problems for the developer when they have a structure with five columns in a row.

Add below CSS to your stylesheet and use col-lg-55, col-md-55, col-sm-55, or col-xs-55 to display five columns in the same row.

/* Five equal columns in Bootstrap 3 */

.col-xs-55, .col-sm-55, .col-md-55, .col-lg-55{
    position: relative;
    min-height: 1px;
    padding-right: 10px;
    padding-left: 10px;
}
.col-xs-55 {
    float:left;
}
.col-xs-55 {
    width: 20%
}

@media (min-width:768px) {
    .col-sm-55 {
        float: left
    }
    .col-sm-55 {
        width: 20%
    }
}

@media (min-width:992px) {
    .col-md-55 {
        float: left
    }
    .col-md-55 {
        width: 20%;
    }
}

@media (min-width:1200px) {
    .col-lg-55 {
        float: left
    }
    .col-lg-55 {
        width: 20%
    }
}

View or fork this snippet on GitHub Gist.

Need this done on a live site? Exivon Tech takes on projects and audits, led by me.

Dhiren Patel

Principal Full-Stack Engineer · Founder, Exivon Tech

I’ve built and run enterprise web platforms and e-commerce for 13 years, and I built ShieldScope, a free WordPress security scanner, and Lede, a free block theme.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.