You can do something like this..

<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal">Popup image</button>

<div id="myModal" class="modal fade" tabindex="-1" role="dialog">
  <div class="modal-dialog">
    <div class="modal-content">
        <div class="modal-body">
            <img src="//placehold.it/1000x600" class="img-responsive">
        </div>
    </div>
  </div>
</div>

Demo: http://www.bootply.com/123443

Answer from Carol Skelly on Stack Overflow
🌐
W3Schools
w3schools.com › howto › howto_css_modal_images.asp
How To Create Modal Images
Learn how to create responsive Modal Images with CSS and JavaScript. A modal is a dialog box/popup window that is displayed on top of the current page.
🌐
Koding Made Simple
kodingmadesimple.com › 2016 › 10 › bootstrap-image-popup-on-click-on-hover-example.html
Bootstrap Image Popup On Click | On Hover | Example
October 17, 2016 - That's why we have added the attributes data-toggle="modal" and data-target="#my-modal" to button element. But you can also do it via JavaScript. Here's another example that uses javascript to show modals.
🌐
Bootstrap Studio Forum
forum.bootstrapstudio.io › bootstrap studio help
Click on a image and display it in modal windows - Bootstrap Studio Help - Bootstrap Studio Forum
June 13, 2022 - Hi, Would anyone have an example (or a component) where users can click on an image to display it larger in a modal window (with just one button to close it) ? In the best World, I would like to use always the same modal windows and give the name of the clicked image in paramaters I know how ...
🌐
CodePen
codepen.io › jhotayex › pen › RaMWVN
Bootstrap link popup image on click
<div class="container"> <div class="row"> <br><br><br> <div class="col-md-3"></div> <div class="col-md-6"> <h1>www.jhotaybd.ml</h1> <a class="" data-toggle="modal" data-target="#popup_img"> Click to see image </a> <!-- popup contain --> <div class="modal fade" id="popup_img" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button> <div class="modal-dialog" role="document"> <img alt="" src="https://d13yacurqjgara.cloudfront.net/users/141092/screenshots/2379154/never-too-old_1x.jpg"> </div> <div class="col-md-3"></div> </div> </div> </div>
Find elsewhere
🌐
Tutorialdeep
tutorialdeep.com › knowhow › bootstrap faqs › open bootstrap modal popup on image click in jquery
Open Bootstrap Modal Popup on Image Click Using jQuery
April 13, 2021 - In this tutorial, learn how to open the Bootstrap modal popup on image click. The short answer is: use jQuery modal('show') to display a modal popup when someone clicks on the image.
🌐
Steemit
steemit.com › utopian-io › @sogata › how-to-pop-up-image-galery-on-modal-using-bootstrap-and-jquery
How to pop-up image galery on modal using bootstrap and jQuery — Steemit
February 7, 2018 - To practice this tutorial need an text editor, browser and host or install Bootstrap and jQuery file (or you can also add Bootstrap and jQuery CDN if you don't want to install or host it). ... In this tutorial, we will create an modal that display the clicked image in galery.
🌐
GeeksforGeeks
geeksforgeeks.org › bootstrap › how-to-fit-the-image-into-modal-popup-using-bootstrap
How to fit the image into modal popup using Bootstrap? - GeeksforGeeks
July 15, 2025 - Bootstrap provides an easy, yet ... and footer. Images can be fitted in modal popup using Bootstrap by including <img> tag in the "modal-body" div....
🌐
CSS-Tricks
css-tricks.com › creating-a-modal-image-gallery-with-bootstrap-components
Creating a Modal Image Gallery With Bootstrap Components | CSS-Tricks
March 6, 2020 - The card works just fine but the carousel on the result tab doesn’t works, I just get the images displayed vertically. ... Hey Damian, thanks for reading. On small screens, the initial photo grid is a single column. And if you tap/click one of the images it’ll open the carousel.
🌐
DivinectorWeb
divinectorweb.com › home › bootstrap › bootstrap 5 image gallery modal popup
Bootstrap 5 image gallery modal popup
July 19, 2023 - Modal popup means that when the image is clicked, the image will be viewed in a larger size. Today we'll share with you an image gallery snippet built with Bootstrap 5 that includes a modal popup.
🌐
MDBootstrap
mdbootstrap.com › standard › modal image
Bootstrap Modal image - free examples & tutorial
An example of the combination of bootstrap modals and youtube video embeds. To learn more read Modals Docs and Embeds Docs. ... <!-- Modal gallery --> <section class=""> <!-- Section: Images --> <section class=""> <div class="row"> <div class="col-lg-4 col-md-12 mb-4 mb-lg-0"> <div class="bg-image hover-overlay ripple shadow-1-strong rounded" data-ripple-color="light" > <img src="https://mdbcdn.b-cdn.net/img/screens/yt/screen-video-1.webp" class="w-100" /> <a href="#!" data-mdb-modal-init data-mdb-target="#exampleModal1"> <div class="mask" style="background-color: rgba(251, 251, 251, 0.2);"></
🌐
HubSpot
community.hubspot.com › t5 › Blog-Website-Page-Publishing › Need-to-create-a-popup-on-click-of-an-image › m-p › 810418
Solved: HubSpot Community - Re: Need to create a popup on click of an image - HubSpot Community
July 4, 2023 - Hi , if you have a developer by your side or are not afraid of using the design-manager/design-tools you could create a custom module for pop-ups. It's a little bit tricky but also not the hardest thing you can create. Here's a step-by-step guide how to create a custom pop-up module Open the d...
🌐
YouTube
youtube.com › esgi coding.
Bootstrap Tutorial - How to Make a Popup Image - YouTube
You know, you can make popup image with just Bootstrap?you don't need any library at all,,,Here's a simple step to make a Popup Image with Bootstrap,Hope it'...
Published   June 1, 2016
Views   12K
🌐
Blogger
codingclas.blogspot.com › 2016 › 10 › bootstrap-image-popup-on-click-on-hover.html
Bootstrap Image Popup On Click | On Hover | Example | Guide Program and Web Development
October 17, 2016 - That's why we have added the attributes data-toggle="modal" and data-target="#my-modal" to button element. But you can also do it via JavaScript. Here's another example that uses javascript to show modals.
🌐
Codeply
codeply.com › go › cMaqclBj8c › bootstrap-popup-modal-image-_-center-vertical
Bootstrap Popup modal image - center vertical on Codeply
HTML, CSS, JavaScript editor playground for designers & developers to compare, prototype and test frontend frameworks
🌐
Bootsnipp
bootsnipp.com › snippets › 33Qjo
Bootstrap Snippet Responsive Lightbox Gallery With Popup on click with Description. NO JS. Only CSS. Any size Image fits Well. Awesome Effects. using HTML CSS Bootstrap
Bootstrap example of Responsive Lightbox Gallery With Popup on click with Description. NO JS. Only CSS. Any size Image fits Well. Awesome Effects. using HTML, Javascript, jQuery, and CSS. Snippet by nabeelkondotty
Top answer
1 of 10
158

You can try this code if you are using bootstrap 3:

HTML

<a href="#" id="pop">
    <img id="imageresource" src="http://patyshibuya.com.br/wp-content/uploads/2014/04/04.jpg" style="width: 400px; height: 264px;">
    Click to Enlarge
</a>
    
<!-- Creates the bootstrap modal where the image will appear -->
<div class="modal fade" id="imagemodal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
        <h4 class="modal-title" id="myModalLabel">Image preview</h4>
      </div>
      <div class="modal-body">
        <img src="" id="imagepreview" style="width: 400px; height: 264px;" >
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>

JavaScript:

$("#pop").on("click", function() {
   $('#imagepreview').attr('src', $('#imageresource').attr('src')); // here asign the image to the modal when the user click the enlarge link
   $('#imagemodal').modal('show'); // imagemodal is the id attribute assigned to the bootstrap modal, then i use the show function
});

This is the working fiddle.

2 of 10
14

I have change it little bit but still can not do few things.

I added that clicking on it close it - it was easy but very functional.

 <div class="modal-dialog" data-dismiss="modal">

I also need different description under each photo. I added description in footer just to show what I need. It need to change with every photo.

HTML

<div class="modal fade" id="imagemodal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog" data-dismiss="modal">
      <div class="modal-content"  >              
        <div class="modal-body">
          <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
             <img src="" class="imagepreview" style="width: 100%;" >
        </div> 
     <div class="modal-footer">
       <div class="col-xs-12">
           <p class="text-left">1. line of description<br>2. line of description <br>3. line of description</p>
       </div>
     </div>         
   </div>
 </div>

JavaScript:

$(function() {
    $('.pop').on('click', function() {
        $('.imagepreview').attr('src', $(this).find('img').attr('src'));
        $('#imagemodal').modal('show');   
    });     
});

Also it would be nice if this window will open only on 100% of screen. Here picture inside with description have more than 100% and in become scrollable... and if screen in much bigger than pictures it shoud stop only on orginal size. for ex. 900 px and no bigger in height.

http://jsfiddle.net/2ve4hbmm/