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
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.
🌐
W3Schools
w3schools.com › howto › tryit.asp
W3Schools Tryit Editor - Image Modal
The W3Schools online code editor allows you to edit code and view the result in your browser
🌐
W3Schools
www-db.deis.unibo.it › courses › TW › DOCS › w3schools › howto › howto_css_modal_images.asp.html
How To Create Modal Images
// Get the modal var modal = document.getElementById('myModal'); // Get the image and insert it inside the modal - use its "alt" text as a caption var img = document.getElementById('myImg'); var modalImg = document.getElementById("img01"); var captionText = document.getElementById("caption"); ...
🌐
insideTheDiv
insidethediv.com › onlick-popup-full-size-image-in-jquery
Click on the image to view full size in a popup modal
To keep the modal hide for the first time we will use CSS display none property. #show_image_popup{ position: absolute; /* so that not take place */ top: 50%; left: 50%; z-index: 1000; /* adobe all elements */ transform: translate(-50%, -50%); /* make center */ display: none; /* to hide first time */ } #show_image_popup img{ max-width: 90%; height: auto; }
🌐
W3Schools
w3schools.com › howto › howto_js_popup.asp
How To Create Popups
Learn how to create popups with CSS and JavaScript. Click me to toggle the popup!
🌐
W3Schools
w3schools.com › howto › howto_js_popup_form.asp
How To Create a Popup Form With CSS
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
🌐
W3Schools
w3schools.com › css › css3_images_modal.asp
CSS Responsive Modal Images
We use CSS to create a modal window (dialog box), and hide it by default. Then, we use a JavaScript to show the modal window with the correct image inside, when a user clicks on the image:
Find elsewhere
Top answer
1 of 4
1

You can use a fancybox to do it.

a {
  color: #FFFFFF;
  text-decoration: none;
}

.primary-btn {
  background-image: -moz-linear-gradient(0deg, #235ee7 0%, #4ae7fa 100%);
  background-image: -webkit-linear-gradient(0deg, #235ee7 0%, #4ae7fa 100%);
  background-image: -ms-linear-gradient(0deg, #235ee7 0%, #4ae7fa 100%);
}

.primary-btn {
  line-height: 36px;
  padding-left: 30px;
  padding-right: 30px;
  border-radius: 25px;
  border: none;
  color: #fff;
  display: inline-block;
  font-weight: 500;
  position: relative;
  -webkit-transition: all 0.3s ease 0s;
  -moz-transition: all 0.3s ease 0s;
  -o-transition: all 0.3s ease 0s;
  transition: all 0.3s ease 0s;
  cursor: pointer;
  text-transform: uppercase;
  position: relative;
}

.primary-btn {
  color: #fff;
  border: 1px solid #fff;
  -webkit-transition: all 0.3s ease 0s;
  -moz-transition: all 0.3s ease 0s;
  -o-transition: all 0.3s ease 0s;
  transition: all 0.3s ease 0s;
}

.primary-btn:hover {
  background: transparent;
  color: #235ee7;
  border-color: #235ee7;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.2.0/jquery.fancybox.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.2.0/jquery.fancybox.min.js"></script>

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.2.0/jquery.fancybox.min.css">
<a data-fancybox="gallery" class="primary-btn" href="//source.unsplash.com/user/erondu/300x300">Demo</a>

2 of 4
0

you are missing the " in onclick and add with _blank for new page .passing the argument with in function using ' quotes

<input type="button" value="Mostra Immagine" onclick="window.open('../img/mypicture.jpg','_blank')">
🌐
W3Schools
w3schools.com › w3css › tryit.asp
W3.CSS Modal Image Gallery
The W3Schools online code editor allows you to edit code and view the result in your browser
🌐
WowOptin
wowoptin.com › make-an-image-popup-in-wordpress
How to Make an Image Popup in WordPress [On Hover, Click & without Plugin]
June 29, 2025 - In this guide, you’ll learn how to easily add WordPress image popups using a bit of code and a plugin (triggered by hover or click). If you want to keep things lightweight and avoid plugins, you can manually add an image popup using HTML, CSS, and a little JavaScript.
🌐
Shoptimized
help.shoptimized.net › en › funnel-buildr › how-to-create-a-clickable-image-popup-2
How to Create a Clickable Image Popup
tClick||(u+=" mfp-auto-cursor"),u&&n.wrap.addClass(u);var l=n.wH=r.height(),m={};if(n.fixedContentPos&&n._hasScrollBar(l)){var o=n._getScrollbarSize();o&&(m.marginRight=o)}n.fixedContentPos&&(n.isIE7?a("body, html").css("overflow","hidden"):m.overflow="hidden");var p=n.st.mainClass;return n.isIE7&&(p+=" mfp-ie7"),p&&n._addClassToMFP(p),n.updateItemHTML(),y("BuildControls"),a("html").css(m),n.bgOverlay.add(n.wrap).prependTo(n.st.prependTo||a(document.body)),n._lastFocusedEl=document.activeElement,setTimeout(function(){n.content?(n._addClassToMFP(k),n._setFocus()):n.bgOverlay.addClass(k),s.on("f
🌐
CodeWithRandom
codewithrandom.com › 2024 › 10 › 01 › create-onclick-image-popup-js
How to Create Onclick Image Popup JavaScript - CodeWithRandom
October 1, 2024 - Then the bars inside the button ,two bars form an “X” (rotate 45deg and -45deg) when clicked. When the popup image is active, .opened sets the display flex for showing the image.
Top answer
1 of 2
1

The span elements should be completely removed and its classes placed on the image elements themselves.

Also, you have a nested section element that isn't doing anything for you.

Lastly, do not use HTML heading elements (<h1>...<h6>) because of the way they style the text. Formatting is the job of CSS. Instead of headings, it is more appropriate to surround each image and its accompanying text with figure and figcaption elements.

img { 
  width:200px;
  border:1px solid black; /* This is only added for testing purposes*/
}

.thumbnail:hover {
   width: 500px;
   height:auto;
   position:relative;
   /* push image to the right by 1/2 the screen width and 1/2 the image width */
   margin-left:calc(50% - 250px);
}
<section id="main">
  <div class="inner">
    <div class="box alt">
      <div class="row 50% uniform">
         <div class="4u">
           <figure>
             <img src="https://pbs.twimg.com/profile_images/562466745340817408/_nIu8KHX.jpeg" alt="" class="thumbnail">
             <figcaption>Marble</figcaption>
           </figure>
         </div>

         <div class="4u">
           <figure>
             <img src="http://www.critterbabies.com/wp-content/gallery/kittens/cats-animals-kittens-background-us.jpg" alt="" class="thumbnail">
             <figcaption>Marble</figcaption>
           </figure>
         </div>
         
         <div class="4u">
           <figure>
             <img src="http://www.warrenphotographic.co.uk/photography/bigs/08482-Fluffy-ginger-female-kitten.jpg" alt="" class="thumbnail">
             <figcaption>Marble</figcaption>
           </figure>
         </div>
         
       </div>
     </div>
   </div>
 </section>

2 of 2
1

I've taken Scott Marcus' answer and adapted to click, which was your original request.

The main diffence is the addition of a tags targeting elements on the page and using :target in the css.

img { 
  width:200px;
  border:1px solid black; /* This is only added for testing purposes*/
}

.thumbnail:target {
   width: 500px;
   height:auto;
   position:relative;
   /* push image to the right by 1/2 the screen width and 1/2 the image width */
   margin-left:calc(50% - 250px);
}
<section id="main">
  <div class="inner">
    <div class="box alt">
      <div class="row 50% uniform">
         <div class="4u">
           <figure>
             <a href="#image1">
             <img src="https://pbs.twimg.com/profile_images/562466745340817408/_nIu8KHX.jpeg" alt="" class="thumbnail" id="image1">
             </a>
             <figcaption>Marble</figcaption>
           </figure>
         </div>

         <div class="4u">
           <figure>
             <a href="#image2">
             <img src="http://www.critterbabies.com/wp-content/gallery/kittens/cats-animals-kittens-background-us.jpg" alt="" class="thumbnail" id="image2">
             </a>
             <figcaption>Marble</figcaption>
           </figure>
         </div>
         
         <div class="4u">
           <figure>
             <a href="#image3">
             <img src="http://www.warrenphotographic.co.uk/photography/bigs/08482-Fluffy-ginger-female-kitten.jpg" alt="" class="thumbnail" id="image3">
             </a>
             <figcaption>Marble</figcaption>
           </figure>
         </div>
         
       </div>
     </div>
   </div>
 </section>

🌐
Willmaster
willmaster.com › library › features › image-popup.php
Image Popup
It has one required onclick attribute to call the JavaScript ShowImagePopup function when the image is clicked. The function's parameters are the id values of the div and img tags in the popup container div and also the URL of the popup image — 4 values in all.
🌐
GeeksforGeeks
geeksforgeeks.org › html › how-to-show-images-on-click-using-html
How to Show Images on Click using HTML ? - GeeksforGeeks
Display Images on Click Using HTML and JavaScript refers to techniques that dynamically show images when a user interacts with a webpage, such as clicking a button. This enhances user engagement by making web pages more interactive, using simple HTML, CSS, and JavaScript methods.
Published   January 10, 2025
🌐
CodePen
codepen.io › Muhnad › pen › dMbXNb
image popup
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Top answer
1 of 3
2

What you are looking for is called a lightbox. Their are many good tutorials on how to make a pure css one, here is a few of them: http://andornagy.com/pure-css-image-lightbox/
http://www.designcouch.com/home/why/2013/11/01/responsive-css3-lightbox-with-no-javascript/
http://www.thecssninja.com/xhtml/futurebox
The problem with using :target as a CSS click event is that it has some downsides such as page jumps or browser history.
You can avoid the downsides of :target by using the checkbox hack:
Make a checkbox and hide it:

<input type="checkbox" id="check" style="display:none;">

Then, make the image you want to have a lightbox for, and wrap it in a <label>

<label for="check">
<img src="http://lorempixel.com/400/400/" width="200">
</label>

Now, write the HTML for the lightbox:

<label for="check">
<div id="cover">
<div id="box">
<img src="http://lorempixel.com/400/400/" width="400">
</div>
</div>
</label>

And now, for the CSS magic! Create the lightbox css:

#cover{
position:absolute;
top:0;
bottom:0;
left:0;
right:0;
background:rgba(0,0,0,0.5);
display:none;
}
#box{
position:absolute;
top:0;
bottom:0;
left:0;
right:0;
margin:auto;
width:400px;
height:400px;
border:10px solid white;
}

This creates and centers the lightbox.
Now you need to add the click event:

#check:checked ~ label #cover{
display:block;
}

This CSS means, If #check is checked (:checked selector), find the sibling (~) with a id of #cover inside a label element and apply the rule to it. That's it!
Your coding should look like this:

<input type="checkbox" id="check" style="display:none;">
<label for="check">
    <img src="http://lorempixel.com/400/400/" width="200">
    </label>
<label for="check">
    <div id="cover">
    <div id="box">
    <img src="http://lorempixel.com/400/400/" width="400">
    </div>
    </div>
    </label>

And CSS:

  #check:checked ~ label #cover{
    display:block;
    }
#cover{
    position:absolute;
    top:0;
    bottom:0;
    left:0;
    right:0;
    background:rgba(0,0,0,0.5);
    display:none;
    }
    #box{
    position:absolute;
    top:0;
    bottom:0;
    left:0;
    right:0;
    margin:auto;
    width:400px;
    height:400px;
    border:10px solid white;
    }

SEE THIS JSFIDDLE

2 of 3
1

I think what you're going for is definitely javascript or Jquery. here is a JSFiddle which shows what i'm on about.

HTML:

<a href="#"><img src="http://0.s3.envato.com/files/19320511/Scenery%2080x80%20Avatar.png"/></a>

<div id="divLargerImage"></div>
<div id="divOverlay"></div>

JQuery:

$('a img').click(function () {
    var $img = $(this);
    $('#divLargerImage').html($img.clone().height(250).width(250)).add($('#divOverlay')).fadeIn();
});

$('#divLargerImage').add($('#divOverlay')).click(function () {
    $('#divLargerImage').add($('#divOverlay')).fadeOut(function () {
        $('#divLargerImage').empty();
    });
});

CSS:

    #divLargerImage
    {
        display: none;
        width: 250px;
        height: 250px;
        position: absolute;
        top: 35%;
        left: 35%;
        z-index: 99;
    }

    #divOverlay
    {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        background-color: #CCC;
        opacity: 0.5;
        width: 100%;
        height: 100%;
        z-index: 98;
    }