Bootstrap snippet and html example. gallery small images with hover

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

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="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

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;}

.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

Lightweight JS to power any interactions this snippet needs. Drop it under your scripts (after Bootstrap 3.3.6) to mirror the live demo.

$(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. Portfolio with details on hover

Portfolio with details on hover

Bootstrap example and template. Bootdey new snippets cards

Bootdey new snippets cards

Bootstrap example and template. social media resumen profile

social media resumen profile

Bootstrap example and template. image post gallery like facebook

image post gallery like facebook

Bootstrap example and template. bs5 dark footer

bs5 dark footer

Bootstrap example and template. Google plus navbar style

Google plus navbar style

Bootstrap example and template. blog post image widget

blog post image widget

Bootstrap example and template. Faq page list

Faq page list

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 small images with hover

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 7.5K+ 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

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