Bootstrap snippet and html example. gallery small images with hover

This html snippet was created to help web designers, web developers, front-end and back-end developer save time. Use it for free in your project and build your app faster, You can also download the HTML, CSS, and JS code.
Tags: images,hover,gallery

HTML code

This is the html code used to create this bootstrap snippet, You can copy and paste the following html code inside a page with bootstrap 3.3.6 included, to get the result that you can see in the preview selection

<div class="container">
<div class="col-md-12">
  <div class="popup-gallery">
    <a href="#" title="Photo 1"><img src="https://www.bootdey.com/image/128x100/FF4500" alt=""></a>
    <a href="#" title="Photo 1"><img src="https://www.bootdey.com/image/128x100/FFA500" alt=""></a>
    <a href="#" title="Photo 1"><img src="https://www.bootdey.com/image/128x100/DA70D6" alt=""></a>
    <a href="#" title="Photo 1"><img src="https://www.bootdey.com/image/128x100/663399" alt=""></a>
    <a href="#" title="Photo 1"><img src="https://www.bootdey.com/image/128x100/4169E1" alt=""></a>
    <a href="#" title="Photo 1"><img src="https://www.bootdey.com/image/128x100/6A5ACD" alt=""></a>
    <a href="#" title="Photo 1"><img src="https://www.bootdey.com/image/128x100/87CEEB" alt=""></a>
    <a href="#" title="Photo 1"><img src="https://www.bootdey.com/image/128x100/4682B4" alt=""></a>
    <a href="#" title="Photo 1"><img src="https://www.bootdey.com/image/128x100/008080" alt=""></a>
    <a href="#" title="Photo 1"><img src="https://www.bootdey.com/image/128x100/40E0D0" alt=""></a>
    <a href="#" title="Photo 1"><img src="https://www.bootdey.com/image/128x100/FA8072" alt=""></a>
    <a href="#" title="Photo 1"><img src="https://www.bootdey.com/image/128x100/663399" alt=""></a>
    <a href="#" title="Photo 1"><img src="https://www.bootdey.com/image/128x100/DDA0DD" alt=""></a>
    <a href="#" title="Photo 1"><img src="https://www.bootdey.com/image/128x100/98FB98" alt=""></a>
    <a href="#" title="Photo 1"><img src="https://www.bootdey.com/image/128x100/AFEEEE" alt=""></a>
    <a href="#" title="Photo 1"><img src="https://www.bootdey.com/image/128x100/FFDAB9" alt=""></a>
    <a href="#" title="Photo 1"><img src="https://www.bootdey.com/image/128x100/EEE8AA" alt=""></a>
    <a href="#" title="Photo 1"><img src="https://www.bootdey.com/image/128x100/000080" alt=""></a>
    <a href="#" title="Photo 1"><img src="https://www.bootdey.com/image/128x100/DDA0DD" alt=""></a>
    <a href="#" title="Photo 1"><img src="https://www.bootdey.com/image/128x100/FF4500" alt=""></a>
    <a href="#" title="Photo 1"><img src="https://www.bootdey.com/image/128x100/6A5ACD" alt=""></a>
    <a href="#" title="Photo 1"><img src="https://www.bootdey.com/image/128x100/87CEEB" alt=""></a>
    <a href="#" title="Photo 1"><img src="https://www.bootdey.com/image/128x100/FA8072" alt=""></a>
    <a href="#" title="Photo 1"><img src="https://www.bootdey.com/image/128x100/663399" alt=""></a>
  </div>
</div>
</div>

<!-- Modal -->
<div class="modal fade" id="modalShow" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">Modal title</h4>
      </div>
      <div class="modal-body text-center">
        ...
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>

CSS code

This is the css code used to create this bootstrap snippet, You can copy and paste the following css code inside a page with bootstrap 3.3.6 included, to get the result that you can see in the preview selection

body{margin-top:20px;}

.popup-gallery a img {
    margin: 2px 0;
    width:128px;
    height:100px;
    
    display: inline-block;
    line-height: 1.42857143;
    background-color: #fff;
    -webkit-transition: border .2s ease-in-out;
    -o-transition: border .2s ease-in-out;
    transition: border .2s ease-in-out;
}

.popup-gallery a img:hover {
	opacity: 0.6;
	filter: alpha(opacity=60); /* For IE8 and earlier */
}

Javascript/Jquery code

This is the javascript code used to create this bootstrap snippet, You can copy and paste the following javascript code inside a page with bootstrap 3.3.6 included, to get the result that you can see in the preview selection

$(document).ready(function() {
  $("img").click(function(){
    var img = $(this).attr("src");
    $("#modalShow .modal-body").html("<img src='"+img+"' class='img-responsive'>");
     $("#modalShow").modal("show");
  });
}) 

Similar snippets

Bootstrap example and template. profile gallery with search input

profile gallery with search input

Bootstrap example and template. bs4 image box

bs4 image box

Bootstrap example and template. collage gallery

collage gallery

Bootstrap example and template. Gallery with pagination

Gallery with pagination

Bootstrap example and template. bs5 dark footer

bs5 dark footer

Bootstrap example and template. profile with data and skills

profile with data and skills

Bootstrap example and template. Invoice

Invoice

Bootstrap example and template. owl carousel courses

owl carousel courses

Bootstrap example and template. gallery small images with hover

About this bootstrap example/template

We hope you will enjoy this awesome snippet and stay tuned for the latest updates, bootdey snippets are already used in thousands of blogs, websites and projects. We believe it will save your precious time and gives trendy look to your next web project.

We always try to offer the best beautiful and responsive source of Bootstrap code examples and components.

This code example currectly have 6.4K views, Using this bootstrap snippet you have the following benefits:

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

Jquery plugins

Great built-in plugins with jquery framework, you can easy to change all declarations

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