content logo

Bootstrap Grids:

Bootstrap Article Grids with Different Heights

If you always upload new information on your website, it is better to use a functional tab to increase its regularity. The Bootstrap Article Grids with Different Heights in this post can be the best idea for all websites with excellent design. This Bootstrap Grids Code is so beneficial and allows you to classify all data and information of your website into different sections. By looking at this preview, you understand that many parts of this code show several items. Using these HTML Grids help you organize your website and attract more people.

This Free Grids Code includes eight sections, and each one has a related icon. The icon is placed on a border, and the backgrounds of all pages and writings are white. These Article Grids in Bootstrap have a simple design, and you can use them on all websites. The titles have a blue color, and you can rename them easily. Icons in this bootstrap have a different appearance, and their colors differ from each other. The shapes of these icons are an image, a camera, birthday cake, cup, and other symbols. These pictures represent the detail of each section. You can download and use the Bootstrap Grids Height from the link below.

#

Bootstrap Grids Code

#

HTML Grids

#

Free Grids Code

#

Article Grids in Bootstrap

#

Bootstrap Grids Height

<!-- This script got from frontendfreecode.com -->
<div class="container">
    <div class="row">
        <h2>Pinterest Responsive Grid</h2>
        <section id="pinBoot">
            <article class="white-panel">
                <i class="fa fa-picture-o image-icons color-1"></i>
                <h4><a href="#">Title 1</a></h4>
                <p>
                    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
                    commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
                    est laborum.
                </p>
            </article>
            <article class="white-panel">
                <i class="fa fa-life-ring image-icons color-3"></i>
                <h4><a href="#">Title 2</a></h4>
                <p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
            </article>
            <article class="white-panel">
                <i class="fa fa-picture-o image-icons color-2"></i>
                <h4><a href="#">Title 3</a></h4>
                <p>
                    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
                    commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
                </p>
            </article>
            <article class="white-panel">
                <i class="fa fa-camera image-icons color-4"></i>
                <h4><a href="#">Title 4</a></h4>
                <p>
                    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
                    commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
                    est laborum.
                </p>
            </article>
            <article class="white-panel">
                <i class="fa fa-birthday-cake image-icons color-3"></i>
                <h4><a href="#">Title 5</a></h4>
                <p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
            </article>
            <article class="white-panel">
                <i class="fa fa-pie-chart image-icons color-1"></i>
                <h4><a href="#">Title 6</a></h4>
                <p>
                    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
                    commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
                </p>
            </article>
            <article class="white-panel">
                <i class="fa fa-coffee image-icons color-2"></i>
                <h4><a href="#">Title 7</a></h4>
                <p>
                    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
                    commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
                    est laborum.
                </p>
            </article>
            <article class="white-panel">
                <i class="fa fa-cubes image-icons color-4"></i>
                <h4><a href="#">Title 8</a></h4>
                <p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
            </article>
        </section>
    </div>
</div><a style="font-size: 8pt; text-decoration: none" target="_blank" href="http://frontendfreecode.com">Free Frontend</a>
                                                                            
body {
    background-color: #eee;
}
#pinBoot {
    position: relative;
    max-width: 100%;
    width: 100%;
}
img {
    width: 100%;
    max-width: 100%;
    height: auto;
}
.white-panel {
    position: absolute;
    background: white;
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3);
    padding: 10px;
}
.white-panel h1 {
    font-size: 1em;
}
.white-panel h1 a {
    color: #a92733;
}
.white-panel:hover {
    box-shadow: 1px 1px 10px rgba(0, 0, 0, 0.5);
    margin-top: -5px;
    -webkit-transition: all 0.3s ease-in-out;
    -moz-transition: all 0.3s ease-in-out;
    -o-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
}
.image-icons {
    width: 100%;
    max-width: 100%;
    height: auto;
    font-size: 100px;
    text-align: center;
    border: solid 1px #ededed;
    border-radius: 8px;
    padding: 10px;
}
.color-1 {
    color: #7d8d91;
}
.color-2 {
    color: #7a5353;
}
.color-3 {
    color: #5f7a53;
}
.color-4 {
    color: #535d7a;
}
$(document).ready(function () {
    $("#pinBoot").pinterest_grid({
        no_columns: 4,
        padding_x: 10,
        padding_y: 10,
        margin_bottom: 50,
        single_column_breakpoint: 700,
    });
});
(function ($, window, document, undefined) {
    var pluginName = "pinterest_grid",
        defaults = {
            padding_x: 10,
            padding_y: 10,
            no_columns: 3,
            margin_bottom: 50,
            single_column_breakpoint: 700,
        },
        columns,
        $article,
        article_width;
    function Plugin(element, options) {
        this.element = element;
        this.options = $.extend({}, defaults, options);
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }
    Plugin.prototype.init = function () {
        var self = this,
            resize_finish;
        $(window).resize(function () {
            clearTimeout(resize_finish);
            resize_finish = setTimeout(function () {
                self.make_layout_change(self);
            }, 11);
        });
        self.make_layout_change(self);
        setTimeout(function () {
            $(window).resize();
        }, 500);
    };
    Plugin.prototype.calculate = function (single_column_mode) {
        var self = this,
            tallest = 0,
            row = 0,
            $container = $(this.element),
            container_width = $container.width();
        $article = $(this.element).children();
        if (single_column_mode === true) {
            article_width = $container.width() - self.options.padding_x;
        } else {
            article_width = ($container.width() - self.options.padding_x * self.options.no_columns) / self.options.no_columns;
        }
        $article.each(function () {
            $(this).css("width", article_width);
        });
        columns = self.options.no_columns;
        $article.each(function (index) {
            var current_column,
                left_out = 0,
                top = 0,
                $this = $(this),
                prevAll = $this.prevAll(),
                tallest = 0;
            if (single_column_mode === false) {
                current_column = index % columns;
            } else {
                current_column = 0;
            }
            for (var t = 0; t < columns; t++) {
                $this.removeClass("c" + t);
            }
            if (index % columns === 0) {
                row++;
            }
            $this.addClass("c" + current_column);
            $this.addClass("r" + row);
            prevAll.each(function (index) {
                if ($(this).hasClass("c" + current_column)) {
                    top += $(this).outerHeight() + self.options.padding_y;
                }
            });
            if (single_column_mode === true) {
                left_out = 0;
            } else {
                left_out = (index % columns) * (article_width + self.options.padding_x);
            }
            $this.css({
                left: left_out,
                top: top,
            });
        });
        this.tallest($container);
        $(window).resize();
    };
    Plugin.prototype.tallest = function (_container) {
        var column_heights = [],
            largest = 0;
        for (var z = 0; z < columns; z++) {
            var temp_height = 0;
            _container.find(".c" + z).each(function () {
                temp_height += $(this).outerHeight();
            });
            column_heights[z] = temp_height;
        }
        largest = Math.max.apply(Math, column_heights);
        _container.css("height", largest + (this.options.padding_y + this.options.margin_bottom));
    };
    Plugin.prototype.make_layout_change = function (_self) {
        if ($(window).width() < _self.options.single_column_breakpoint) {
            _self.calculate(true);
        } else {
            _self.calculate(false);
        }
    };
    $.fn[pluginName] = function (options) {
        return this.each(function () {
            if (!$.data(this, "plugin_" + pluginName)) {
                $.data(this, "plugin_" + pluginName, new Plugin(this, options));
            }
        });
    };
})(jQuery, window, document);
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css">
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- This script got from frontendfreecode.com -->

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css">
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<style>
body {
    background-color: #eee;
}
#pinBoot {
    position: relative;
    max-width: 100%;
    width: 100%;
}
img {
    width: 100%;
    max-width: 100%;
    height: auto;
}
.white-panel {
    position: absolute;
    background: white;
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3);
    padding: 10px;
}
.white-panel h1 {
    font-size: 1em;
}
.white-panel h1 a {
    color: #a92733;
}
.white-panel:hover {
    box-shadow: 1px 1px 10px rgba(0, 0, 0, 0.5);
    margin-top: -5px;
    -webkit-transition: all 0.3s ease-in-out;
    -moz-transition: all 0.3s ease-in-out;
    -o-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
}
.image-icons {
    width: 100%;
    max-width: 100%;
    height: auto;
    font-size: 100px;
    text-align: center;
    border: solid 1px #ededed;
    border-radius: 8px;
    padding: 10px;
}
.color-1 {
    color: #7d8d91;
}
.color-2 {
    color: #7a5353;
}
.color-3 {
    color: #5f7a53;
}
.color-4 {
    color: #535d7a;
}
</style>

</head>
<body>
<div class="container">
    <div class="row">
        <h2>Pinterest Responsive Grid</h2>
        <section id="pinBoot">
            <article class="white-panel">
                <i class="fa fa-picture-o image-icons color-1"></i>
                <h4><a href="#">Title 1</a></h4>
                <p>
                    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
                    commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
                    est laborum.
                </p>
            </article>
            <article class="white-panel">
                <i class="fa fa-life-ring image-icons color-3"></i>
                <h4><a href="#">Title 2</a></h4>
                <p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
            </article>
            <article class="white-panel">
                <i class="fa fa-picture-o image-icons color-2"></i>
                <h4><a href="#">Title 3</a></h4>
                <p>
                    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
                    commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
                </p>
            </article>
            <article class="white-panel">
                <i class="fa fa-camera image-icons color-4"></i>
                <h4><a href="#">Title 4</a></h4>
                <p>
                    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
                    commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
                    est laborum.
                </p>
            </article>
            <article class="white-panel">
                <i class="fa fa-birthday-cake image-icons color-3"></i>
                <h4><a href="#">Title 5</a></h4>
                <p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
            </article>
            <article class="white-panel">
                <i class="fa fa-pie-chart image-icons color-1"></i>
                <h4><a href="#">Title 6</a></h4>
                <p>
                    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
                    commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
                </p>
            </article>
            <article class="white-panel">
                <i class="fa fa-coffee image-icons color-2"></i>
                <h4><a href="#">Title 7</a></h4>
                <p>
                    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
                    commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
                    est laborum.
                </p>
            </article>
            <article class="white-panel">
                <i class="fa fa-cubes image-icons color-4"></i>
                <h4><a href="#">Title 8</a></h4>
                <p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
            </article>
        </section>
    </div>
</div><div id="bcl"><a style="font-size:8pt;text-decoration:none;" href="http://www.devanswer.com">Free Frontend</a></div>
<script>
$(document).ready(function () {
    $("#pinBoot").pinterest_grid({
        no_columns: 4,
        padding_x: 10,
        padding_y: 10,
        margin_bottom: 50,
        single_column_breakpoint: 700,
    });
});
(function ($, window, document, undefined) {
    var pluginName = "pinterest_grid",
        defaults = {
            padding_x: 10,
            padding_y: 10,
            no_columns: 3,
            margin_bottom: 50,
            single_column_breakpoint: 700,
        },
        columns,
        $article,
        article_width;
    function Plugin(element, options) {
        this.element = element;
        this.options = $.extend({}, defaults, options);
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }
    Plugin.prototype.init = function () {
        var self = this,
            resize_finish;
        $(window).resize(function () {
            clearTimeout(resize_finish);
            resize_finish = setTimeout(function () {
                self.make_layout_change(self);
            }, 11);
        });
        self.make_layout_change(self);
        setTimeout(function () {
            $(window).resize();
        }, 500);
    };
    Plugin.prototype.calculate = function (single_column_mode) {
        var self = this,
            tallest = 0,
            row = 0,
            $container = $(this.element),
            container_width = $container.width();
        $article = $(this.element).children();
        if (single_column_mode === true) {
            article_width = $container.width() - self.options.padding_x;
        } else {
            article_width = ($container.width() - self.options.padding_x * self.options.no_columns) / self.options.no_columns;
        }
        $article.each(function () {
            $(this).css("width", article_width);
        });
        columns = self.options.no_columns;
        $article.each(function (index) {
            var current_column,
                left_out = 0,
                top = 0,
                $this = $(this),
                prevAll = $this.prevAll(),
                tallest = 0;
            if (single_column_mode === false) {
                current_column = index % columns;
            } else {
                current_column = 0;
            }
            for (var t = 0; t < columns; t++) {
                $this.removeClass("c" + t);
            }
            if (index % columns === 0) {
                row++;
            }
            $this.addClass("c" + current_column);
            $this.addClass("r" + row);
            prevAll.each(function (index) {
                if ($(this).hasClass("c" + current_column)) {
                    top += $(this).outerHeight() + self.options.padding_y;
                }
            });
            if (single_column_mode === true) {
                left_out = 0;
            } else {
                left_out = (index % columns) * (article_width + self.options.padding_x);
            }
            $this.css({
                left: left_out,
                top: top,
            });
        });
        this.tallest($container);
        $(window).resize();
    };
    Plugin.prototype.tallest = function (_container) {
        var column_heights = [],
            largest = 0;
        for (var z = 0; z < columns; z++) {
            var temp_height = 0;
            _container.find(".c" + z).each(function () {
                temp_height += $(this).outerHeight();
            });
            column_heights[z] = temp_height;
        }
        largest = Math.max.apply(Math, column_heights);
        _container.css("height", largest + (this.options.padding_y + this.options.margin_bottom));
    };
    Plugin.prototype.make_layout_change = function (_self) {
        if ($(window).width() < _self.options.single_column_breakpoint) {
            _self.calculate(true);
        } else {
            _self.calculate(false);
        }
    };
    $.fn[pluginName] = function (options) {
        return this.each(function () {
            if (!$.data(this, "plugin_" + pluginName)) {
                $.data(this, "plugin_" + pluginName, new Plugin(this, options));
            }
        });
    };
})(jQuery, window, document);
</script>

</body>
</html>
Preview