You can use a lightbox to do it.

There is a simple example in this link:

http://lokeshdhakar.com/projects/lightbox2/

Answer from Jack on Stack Overflow
๐ŸŒ
W3Schools
w3schools.com โ€บ howto โ€บ howto_css_modal_images.asp
How To Create Modal Images
Fullscreen Video Modal Boxes Delete Modal Timeline Scroll Indicator Progress Bars Skill Bar Range Sliders Color Picker Email Field Tooltips Display Element Hover Popups Collapsible Calendar HTML Includes To Do List Loaders Badges Star Rating User Rating Overlay Effect Contact Chips Cards Flip Card Profile Card Product Card Alerts Callout Notes Labels Ribbon Tag Cloud Circles Style HR Coupon List Group List Group with Badges List Without Bullets Responsive Text Cutout Text Glowing Text Fixed Footer Sticky Element Equal Height Clearfix Responsive Floats Snackbar Fullscreen Window Scroll Drawing
Discussions

Trying to show image in popup box when I hover over a button - HTML & CSS - SitePoint Forums | Web Development & Design Community
I am trying to get an image to show in a pop-up box when I hover over the button, my html is simple and shows a message when I try it but when I put an image into the code it does nothing. Sample button , this is the piano key i am sing. would any one have any ideas on how this can be done, ... More on sitepoint.com
๐ŸŒ sitepoint.com
0
August 5, 2016
Text link to image popup
Hi there, I'd like for some text on my homepage to open a popup of an image with a subtitle/caption when you click on the text link. More on forum.muffingroup.com
๐ŸŒ forum.muffingroup.com
August 19, 2020
I have developed a Responsive Popup Image Gallery in HTML, check and give you reviews.
Youโ€™re spamming this everywhere. So Iโ€™m gonna spam back with better galleries https://codestitch.app/app/dashboard/catalog/sections/5 More on reddit.com
๐ŸŒ r/webdev
4
0
June 13, 2024
html - How do I make an image automatically popup on my main page when someone goes to it? - Stack Overflow
I want an image to automatically popup when someone goes to our main page. One that they can click to close after they have seen it. Can someone please show me how to do this that doesn't require a... More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
W3Schools
w3schools.com โ€บ css โ€บ css3_images_modal.asp
CSS Responsive Modal Images
When a user clicks on a modal image, it shows a popup window that appears on top of the main content of the webpage, often with a semi-transparent background. The modal must be closed by the user, typically with a "close" button or an "X" sign ...
๐ŸŒ
HubSpot
community.hubspot.com โ€บ t5 โ€บ Blog-Website-Page-Publishing โ€บ Need-to-create-a-popup-on-click-of-an-image โ€บ m-p โ€บ 808975
Solved: HubSpot Community - Need to create a popup on click of an image - HubSpot Community
July 4, 2023 - There are A LOT possibilities how to create pop-up modules. Some are just plain HTML+CSS but most of them take advantage of some sort of JavaScript (libraries).
๐ŸŒ
Unc
opal.ils.unc.edu โ€บ ~lblakej โ€บ website-helps โ€บ 04-image-popup
Image Popup Example
Click image to popup the larger image with the alt text as the caption.
๐ŸŒ
JCE
joomlacontenteditor.net โ€บ support โ€บ tutorials โ€บ jcemediabox โ€บ create-an-image-popup
Create an image Popup
Some formats such as images and social media like Youtube and Vimeo etc. can be detected from the popup url by JCE MediaBox ยท Parameters - Set additonal parameters. Click Insert. A browser cookie is used to store the autopopup state - whether it has been opened already - when using Autopopup Single. Example HTML created by these steps : <a class="jcepopup" title="Desert" href="/images/desert.jpg" data-mediabox="1" data-mediabox-group="nature" data-mediabox-title="Desert" data-mediabox-caption="Picture of a desert"><img title="winter.jpg" width="200" src="/images/desert.jpg" alt="Winter" /></a> Simple gallery using 2 grouped images ยท
๐ŸŒ
SitePoint
sitepoint.com โ€บ html & css
Trying to show image in popup box when I hover over a button - HTML & CSS - SitePoint Forums | Web Development & Design Community
August 5, 2016 - I am trying to get an image to show in a pop-up box when I hover over the button, my html is simple and shows a message when I try it but when I put an image into the code it does nothing. Sample button <!--<li><a hrefโ€ฆ
Find elsewhere
๐ŸŒ
Hashnode
devlawrence.hashnode.dev โ€บ how-to-create-an-image-pop-up-gallery
How to create an image pop-up gallery - Dev Lawrence
August 31, 2022 - In this article, We will be creating ... of doing this is that when a user visits your website and clicks on an image in the image gallery, a larger version of that image should be opened in a modal....
๐ŸŒ
Poper
poper.ai โ€บ guides โ€บ how-to-make-a-popup-image-in-html
How To Make a Popup Image in HTML - Poper
May 8, 2025 - How To Make a Popup Image in HTML: Discover step-by-step instructions to create responsive image popups using HTML, CSS, and JavaScript for an engaging user experience.
๐ŸŒ
W3Schools
w3schools.com โ€บ howto โ€บ howto_js_popup.asp
How To Create Popups
Alert Buttons Outline Buttons Split Buttons Animated Buttons Fading Buttons Button on Image Social Media Buttons Read More Read Less Loading Buttons Download Buttons Pill Buttons Notification Button Icon Buttons Next/prev Buttons More Button in Nav Block Buttons Text Buttons Round Buttons Scroll To Top Button ยท Login Form Signup Form Checkout Form Contact Form Social Login Form Register Form Form with Icons Newsletter Stacked Form Responsive Form Popup Form Inline Form Clear Input Field Hide Number Arrows Copy Text to Clipboard Animated Search Search Button Fullscreen Search Input Field in Navbar Login Form in Navbar Custom Checkbox/Radio Custom Select Toggle Switch Check Checkbox Detect Caps Lock Trigger Button on Enter Password Validation Toggle Password Visibility Multiple Step Form Autocomplete Turn off autocomplete Turn off spellcheck File Upload Button Empty Input Validation
๐ŸŒ
Sawtooth
community.sawtoothsoftware.com โ€บ lighthouse-studio โ€บ post โ€บ image-in-html-popup-window-HndfmgjKyMhurjT
Image in HTML popup window
March 24, 2023 - Hi all, I have created a separate html file that is a popup window in my survey. I saved the html file within the graphics folder. I want to display a picture of the radiobutton_unselected.png within ...
๐ŸŒ
Muffingroup
forum.muffingroup.com โ€บ betheme โ€บ discussion โ€บ 55806 โ€บ text-link-to-image-popup
Text link to image popup โ€” Betheme Support Forum
August 19, 2020 - About the image, you can insert the <img> tag or [image] shortcode inside the content of the popup/lightbox.
๐ŸŒ
Reddit
reddit.com โ€บ r/webdev โ€บ i have developed a responsive popup image gallery in html, check and give you reviews.
r/webdev on Reddit: I have developed a Responsive Popup Image Gallery in HTML, check and give you reviews.
June 13, 2024 - A website builder that lets you download the site as an HTML/CSS template and does not require signing up. ... Looking to create a woo product slideshow (using ACF image) with popup for adding to cart.
Top answer
1 of 1
7

I would do this with jQuery (and I bet you're using jQuery for your template too :) )

Be sure you're calling the jQuery library in your page, I would recommend to place it just before the </body> tag and BELOW all the scripts.

for example

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <!-- let's call the following div as the POPUP FRAME -->
<div id="popup">

    <!-- and here comes the image -->
    <img src="http://i.imgur.com/cVJrCHU.jpg" alt="popup">

        <!-- Now this is the button which closes the popup-->
        <button id="close">Close button</button>

        <!-- and finally we close the POPUP FRAME-->
        <!-- everything on it will show up within the popup so you can add more things not just an image -->
</div>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

<script>
//your jquery script here
</script>

</body>
</html>

This will show up a piece of code, if you want to simply show an image, put the id="popup" directly on your <img> tag.

Now, let's move to the example... the code is pretty easy to understand:

//with this first line we're saying: "when the page loads (document is ready) run the following script"
$(document).ready(function () {

    //select the POPUP FRAME and show it
    $("#popup").hide().fadeIn(1000);

    //close the POPUP if the button with id="close" is clicked
    $("#close").on("click", function (e) {
        e.preventDefault();
        $("#popup").fadeOut(1000);
    });

});

The script behaves like this: When the page is loaded, the content inside <div id="popup"> show up, and if the button with id="close" is clicked, then the pop up is hidden. Add whatever you want inside this <div id="popup"> and it will show inside the popup.

The CSS: SUPER IMPORTANT!

/*we need to style the popup with CSS so it is placed as a common popup does*/
    #popup {
            display:none;
            position:absolute;
            margin:0 auto;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            z-index: 9999;
    }

You can see it working along with the HTML on this live example:

http://jsfiddle.net/Lp9edyg5/1/

๐ŸŒ
HUGO
discourse.gohugo.io โ€บ using themes
[images module] Full size popup - Using Themes - HUGO
June 29, 2024 - In a simple site using the mainroad theme and the images module I have a page bundle that includes a png image. The images module allows me to use this in markdown content with ![Alt](image.png) The image is displayed and scaled to fit, nice, but I would have expected to be able to click on ...
๐ŸŒ
CodePen
codepen.io โ€บ Muhnad โ€บ pen โ€บ dMbXNb
image popup
Minimize HTML Editor ยท Fold All ยท Unfold All ยท <div class="popup"> <img src="http://images.entertainment.ie/images_content/rectangle/620x372/success-kid.jpg"> <img src="https://pbs.twimg.com/media/CX1PAZwVAAANemW.jpg"> <img src="http://images5.fanpop.com/image/photos/30900000/beautiful-pic-different-beautiful-pictures-30958249-1600-1200.jpg"> </div> <div class="show"> <div class="overlay"></div> <div class="img-show"> <span>X</span> <img src=""> </div> </div> <!--End image popup--> !
๐ŸŒ
DEV Community
dev.to โ€บ pachicodes โ€บ creating-a-css-modal-window-pop-up-step-by-step-1f59
Creating a CSS modal window (pop-up) step-by-step - DEV Community
January 20, 2020 - Great article. I didn't know neither about :target (supports from Chrome 1) nor <dialog> ๐Ÿคฆ shame on me. Speaking about the code, just noticed your modal behaves different than the one from MDN: click to grey area doesn't close the popup (::backdrop in case of dialog element).
๐ŸŒ
DEV Community
dev.to โ€บ sarah_chima โ€บ image-popup-on-hover-1kee
Image Popup on hover - DEV Community
October 12, 2018 - I did not know how to do it but ... This technique is placing two images side by side, the thumbnail image(smaller image) and a larger image which will appear when you hover over the thumbnail image....