Bootstrap snippet and html example. Gallery with pagination

Bootstrap 3.3.6 snippet "Gallery with pagination" with HTML, CSS, and JS. Copy, paste, and customize this responsive UI component for your project.
Tags: gallery,images

HTML code

Clean, semantic HTML that powers this Bootstrap 3.3.6 snippet. Copy and paste it into your page (with Bootstrap loaded) to reproduce the exact layout shown in the preview.

<div class="container">
    <div class="row">
        <div class="col-md-12">
            <div id="grid" class="row">
                <div class="mix col-sm-3 page1 page4 margin30">
                    <div class="item-img-wrap ">
                        <img src="https://www.bootdey.com/image/312x315/FFB6C1/000000" class="img-responsive" alt="workimg">
                        <div class="item-img-overlay">
                            <a href="#" class="show-image">
                                <span></span>
                            </a>
                        </div>
                    </div> 

                </div>
                <div class="mix col-sm-3 page2 page3 margin30">
                    <div class="item-img-wrap ">
                        <img src="https://www.bootdey.com/image/312x315/20B2AA/000000" class="img-responsive" alt="workimg">
                        <div class="item-img-overlay">
                            <a href="#" class="show-image">
                                <span></span>
                            </a>
                        </div>
                    </div> 

                </div>
                <div class="mix col-sm-3  page3 page2 margin30 ">
                    <div class="item-img-wrap ">
                        <img src="https://www.bootdey.com/image/312x315/87CEFA/000000" class="img-responsive" alt="workimg">
                        <div class="item-img-overlay">
                            <a href="#" class="show-image">
                                <span></span>
                            </a>
                        </div>
                    </div> 

                </div>
                <div class="mix col-sm-3  page4 margin30">
                    <div class="item-img-wrap ">
                        <img src="https://www.bootdey.com/image/312x315/EE82EE/000000" class="img-responsive" alt="workimg">
                        <div class="item-img-overlay">
                            <a href="#" class="show-image">
                                <span></span>
                            </a>
                        </div>
                    </div> 

                </div>
                <div class="mix col-sm-3 page1 margin30 ">
                    <div class="item-img-wrap ">
                        <img src="https://www.bootdey.com/image/312x315/#FF6347/000000" class="img-responsive" alt="workimg">
                        <div class="item-img-overlay">
                            <a href="#" class="show-image">
                                <span></span>
                            </a>
                        </div>
                    </div> 

                </div>
                <div class="mix col-sm-3  page2 margin30">
                    <div class="item-img-wrap ">
                        <img src="https://www.bootdey.com/image/312x315/008080/000000" class="img-responsive" alt="workimg">
                        <div class="item-img-overlay">
                            <a href="#" class="show-image">
                                <span></span>
                            </a>
                        </div>
                    </div> 

                </div>
                <div class="mix col-sm-3  page3 margin30">
                    <div class="item-img-wrap ">
                        <img src="https://www.bootdey.com/image/312x315/DDA0DD/000000" class="img-responsive" alt="workimg">
                        <div class="item-img-overlay">
                            <a href="#" class="show-image">
                                <span></span>
                            </a>
                        </div>
                    </div> 

                </div>
                <div class="mix col-sm-3 page4  margin30">
                    <div class="item-img-wrap ">
                        <img src="https://www.bootdey.com/image/312x315/FFA500/000000" class="img-responsive" alt="workimg">
                        <div class="item-img-overlay">
                            <a href="#" class="show-image">
                                <span></span>
                            </a>
                        </div>
                    </div> 
                </div>                                                            
            </div><!--grid-->
        </div>
    </div>
    <div class="row gallery-bottom">
        <div class="col-sm-6">
            <ul class="pagination">
                <li>
                    <a href="#" aria-label="Previous">
                        <span aria-hidden="true">«</span>
                    </a>
                </li>
                <li class="active"><a href="#">1</a></li>
                <li><a href="#">2</a></li>
                <li><a href="#">3</a></li>
                <li><a href="#">4</a></li>
                <li><a href="#">5</a></li>
                <li>
                    <a href="#" aria-label="Next">
                        <span aria-hidden="true">»</span>
                    </a>
                </li>
            </ul>
        </div>
        <div class="col-sm-6 text-right">
            <em>Displaying 1 to 8 (of 100 posts)</em>
        </div>
    </div>
</div>

CSS code

Scoped CSS that styles the component. Paste it after Bootstrap 3.3.6 to keep the design, spacing, and responsiveness consistent.

body{margin-top:20px;}

.margin30 {
    margin-bottom: 30px;
}

.item-img-wrap {
    position: relative;
    text-align: center;
    overflow: hidden;
}

.item-img-wrap img {
    -moz-transition: all 200ms linear;
    -o-transition: all 200ms linear;
    -webkit-transition: all 200ms linear;
    transition: all 200ms linear;
    width: 100%;
}

/************************image hover effect*******************/
.item-img-wrap {
  position: relative;
  text-align: center;
  overflow: hidden;
}

.item-img-wrap img {
  -moz-transition: all 200ms linear;
  -o-transition: all 200ms linear;
  -webkit-transition: all 200ms linear;
  transition: all 200ms linear;
  width: 100%;
}

.item-img-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
}

.item-img-overlay span {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background: url(http://bootstraplovers.com/templates/assan-2.2/main-template/img/plus.png) no-repeat center center rgba(0, 0, 0, 0.7);
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
  filter: alpha(opacity=0);
  opacity: 0;
  -moz-transition: opacity 250ms linear;
  -o-transition: opacity 250ms linear;
  -webkit-transition: opacity 250ms linear;
  transition: opacity 250ms linear;
}

.item-img-wrap:hover .item-img-overlay span {
  opacity: 1;
}

.item-img-wrap:hover img {
  -moz-transform: scale(1.1);
  -o-transform: scale(1.1);
  -ms-transform: scale(1.1);
  -webkit-transform: scale(1.1);
  transform: scale(1.1);
}


/*************pagination***********/
.gallery-bottom .pagination {
  margin-top: 0px;
}

.pagination > li > a, .pagination > li > span {
  background-color: #ccc;
  padding: 3px 9px;
  color: #fff;
  border: 0px;
}

.pagination > li > a {
  margin-right: 5px;
}

.pagination > .active > a, .pagination > .active > span, .pagination > .active > a:hover, .pagination > .active > span:hover, .pagination > .active > a:focus, .pagination > .active > span:focus {
  background-color: #32c5d2;
}

Similar snippets

Bootstrap example and template. bs4 blog post with image hover

bs4 blog post with image hover

Bootstrap example and template. gallery item

gallery item

Bootstrap example and template. gallery with small images

gallery with small images

Bootstrap example and template. bs4 widget image cards

bs4 widget image cards

Bootstrap example and template. bs5 dark footer

bs5 dark footer

Bootstrap example and template. Box Product List

Box Product List

Bootstrap example and template. Forum post list

Forum post list

Bootstrap example and template. User profile resume

User profile resume

FAQ

How do I use this snippet?

Include Bootstrap 3.3.6, paste the HTML, add the CSS block, and include the JS (if any) to mirror the live preview.

Can I use it in commercial projects?

Yes. It’s free for personal and commercial work; check the snippets license for details.

Is it responsive?

Yes. It inherits the responsive grid and components from Bootstrap 3.3.6.

Bootstrap example and template. Gallery with pagination

About this bootstrap example/template

Optimized for copy‑paste: clean HTML, scoped CSS, and minimal JS so you can ship production‑ready UI faster and keep designs consistent.

Mobile‑first and responsive by default. Tested across modern browsers to reduce polish time on your project.

Already trusted in 32.3K+ views. Reuse this snippet to speed up landing pages, dashboards, or onboarding flows.

Bootstrap 3.3.6

<link rel='stylesheet' href='https://netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css'>

<script src='https://netdna.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js'></script>

This code example is based on bootstrap 3.3.6 and the grid system of this framework

Responsive

Based on bootstrap framework makes all the layouts perfectly responsive for all devices

Crossbrowser compatibility

Tested on all major browsers, it works smoothly on all of them

semantic html 5

Built on html / css3 the code quality is really amazing

Simple Integration

This code example can be simply integrated on existing sites and new ones too, all you need to do is copy the code and start working