DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk8 min

How to Make a JPG Image Clickable with an HTML Link

Wrap an HTML img element in an anchor, set href to the destination, src to the JPG, and alt to a useful action description. This guide covers galleries, downloads, new tabs, accessibility, CSS, troubleshooting, and testing.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Wrap the JPG’s <img> element in an <a> element. Put the destination in href, the image file in src, and a useful action or destination description in alt:

<a href="https://example.com/gallery">
  <img src="images/photo.jpg" alt="Open the photo gallery">
</a>

The whole image then behaves as a link. The JPG file itself is not interactive; the surrounding HTML anchor supplies the click behavior.

The basic clickable-JPG pattern

An image link has two nested elements: an anchor (<a>) on the outside and an image (<img>) inside it. The browser uses the anchor’s href as the destination whenever the linked image is clicked or activated with the keyboard.

<a href="https://example.com/gallery">
  <img src="images/photo.jpg" alt="Open the photo gallery">
</a>

Keep the opening and closing anchor tags around the image. Placing the two tags beside each other does not make the image clickable.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Lexar D40E 128GB Dual USB 3.2 Gen 1 Type-C Jump Drive, Champagne Silver
  • USB-C 2-in-1 storage OTG: The Lexar JumpDrive Dual Drive D40E features USB Type-A and Type-C connectors in a slim, portable form factor for easy device compatibility
  • Transfer speeds up to 100MB/s: Based on internal testing, performance may vary depending upon the host device, interface, and usage conditions. 1MB=1,000,000 bytes
  • Plug and Play: Widely compatible with USB Type-C smartphones, tablets, laptops, Macs, and traditional Type-A devices, no software installation required. The 360° swivel design allows for easy switching between connectors without the hassle of losing a cap
  • Durable & Compact: The Lexar D40E USB memory stick features a metal enclosure, withstands temperatures from 0° to 50° C (32°F to 122°F), and is lightweight at 26g with dimensions of 70.4 x 16.9 x 11.7mm
  • Security & Warranty: Securely protects files using an advanced security software solution with 256-bit AES encryption. Backed by a Lexar 3-year limited warranty

What each attribute does

Part Purpose Example
href on <a> Sets the page, file, URL, or fragment opened by the link. /gallery/index.html
src on <img> Identifies the JPG displayed inside the link. images/photo.jpg
alt on <img> Provides the accessible name when the image cannot be seen or loaded. View the conference schedule

href and src are independent. You can display a thumbnail from one path and send the visitor to a different page or full-size file.

Choose the destination you need

Link to another page on the same site

Use a site-relative path when the destination belongs to the same website. The leading slash starts at the site root.

<a href="/about.html">
  <img src="team.jpg" alt="Read about our team">
</a>

A path without a leading slash is relative to the current document’s folder, so gallery.html and gallery/index.html resolve from that location.

Link to an external website

An absolute HTTPS URL works for another domain:

<a href="https://developer.mozilla.org/">
  <img src="mdn-logo.jpg" alt="Visit MDN Web Docs">
</a>

Describe the external destination in the alternative text rather than using a vague label such as “image.”

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Open the full-size JPG

Use a smaller thumbnail in src and the large file in href:

Rank #2
SANDISK 128GB Ultra Flair, USB-A Flash Drive, Up to 150MB/s Read Speeds
  • High-speed USB 3.0 performance of up to 150MB/s(1) [(1) Write to drive up to 15x faster than standard USB 2.0 drives (4MB/s); varies by drive capacity. Up to 150MB/s read speed. USB 3.0 port required. Based on internal testing; performance may be lower depending on host device, usage conditions, and other factors; 1MB=1,000,000 bytes]
  • Transfer a full-length movie in less than 30 seconds(2) [(2) Based on 1.2GB MPEG-4 video transfer with USB 3.0 host device. Results may vary based on host device, file attributes and other factors]
  • Transfer to drive up to 15 times faster than standard USB 2.0 drives(1)
  • Sleek, durable metal casing
  • Easy-to-use password protection for your private files(3) [(3)Password protection uses 128-bit AES encryption and is supported by Windows 7, Windows 8, Windows 10, and Mac OS X v10.9 plus; Software download required for Mac, visit the SanDisk SecureAccess support page]
<a href="images/photo-large.jpg">
  <img src="images/photo-thumb.jpg" alt="View the full-size photo">
</a>

This is useful for galleries because the page initially loads a lighter image while the click opens the original.

Jump to a section on the current page

A fragment identifier in href scrolls to the element whose id matches it:

<a href="#details">
  <img src="photo.jpg" alt="Jump to photo details">
</a>

<section id="details">
  <h2>Photo details</h2>
</section>

Start a download

Point the anchor at the downloadable JPG. The server’s response headers influence whether the browser displays it or downloads it; the HTML link alone cannot force every browser to save a file.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
<a href="downloads/original-photo.jpg">
  <img src="images/photo-thumb.jpg" alt="Download the original photo">
</a>

Opening the link in a new tab

Add target="_blank" only when a separate browsing context is genuinely useful. Tell users that a new tab will open in the accessible wording.

<a href="https://example.com/gallery"
   target="_blank"
   rel="noopener">
  <img src="photo.jpg" alt="Open the gallery in a new tab">
</a>

target="_blank" changes where the destination opens. The rel="noopener" value is a defensive compatibility practice for new-tab links; it is not what makes the image clickable. If you do not want a new tab, omit both attributes and let the link open normally.

Rank #3
2 Pack 64GB USB Flash Drive USB 2.0 Thumb Drives Jump Drive Fold Storage Memory Stick Swivel Design - Black
  • What You Get - 2 pack 64GB genuine USB 2.0 flash drives, 12-month warranty and lifetime friendly customer service
  • Great for All Ages and Purposes – the thumb drives are suitable for storing digital data for school, business or daily usage. Apply to data storage of music, photos, movies and other files
  • Easy to Use - Plug and play USB memory stick, no need to install any software. Support Windows 7 / 8 / 10 / Vista / XP / Unix / 2000 / ME / NT Linux and Mac OS, compatible with USB 2.0 and 1.1 ports
  • Convenient Design - 360°metal swivel cap with matt surface and ring designed zip drive can protect USB connector, avoid to leave your fingerprint and easily attach to your key chain to avoid from losing and for easy carrying
  • Brand Yourself - Brand the flash drive with your company's name and provide company's overview, policies, etc. to the newly joined employees or your customers

Write accessible alternative text

When the image is the only content inside the anchor, its alt text becomes the link’s accessible name. Describe the action or destination:

  • alt="Open the photo gallery" tells a screen-reader user what activation does.
  • alt="View the conference schedule" identifies the destination’s purpose.
  • alt="Download the JPG (opens in new tab)" discloses both the action and the browsing behavior.

Avoid alt="image", alt="photo", or a filename when those words do not explain where the link goes. If nearby text already communicates the destination and the image is purely decorative, use alt="" so assistive technology does not announce the same link twice. Do not remove alt altogether.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a real destination in href. Values such as # and javascript:void(0) are not substitute links for actions. If the control performs an action instead of navigating, use a real <button> and add JavaScript behavior to that button.

Styling and usability details

Remove an unwanted border

Some older browser styles displayed a border around linked images. A small CSS rule keeps the presentation consistent:

a img {
  border: 0;
}

Do not remove the keyboard focus indicator from the anchor. If your design supplies its own focus style, make it clearly visible:

Rank #4
SIMMAX 32GB Memory Stick USB 2.0 Flash Drives Swivel Thumb Drive Pen Drive (32GB Purple)
  • GOOD VALUE PACKAGE - 1 Pack 32GB Memory Stick USB 2.0 Flash Drives with great cost performance and high quality.
  • BIG CAPACITY - The available capacity: 29.10GB-29.8GB, You can save the data of movies, music, photos, designs, programs, manuals, handouts in a high speed.Good performance in digital data storing, transferring and sharing with families, friends, workmates, clients and machines.
  • EASY TO USE & PLUG AND WORK - Support windows 7 / 8 / 10 / Vista / XP / 2000 / ME / NT Linux and Mac OS, Compatible with USB2.0 and below.
  • TWISTTURN DESIGN & EASY CARRY - The metal clip rotates 360° round the ABS plastic body which with rubber oil skin feeling finish. The capless design can avoid lossing of cap, and providing efficient protection to the USB port.
  • WARRANTY & SUPPORT - SIMMAX logo is laser printed on the USB connector surface, our products are of good quality and we promise that any problem about the product within one year since you buy.
a:focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 3px;
}

Make the target comfortable on touch screens

Keep the linked image large enough to activate without accidentally hitting a neighboring control. When the design permits, add spacing around adjacent links and avoid tightly packed thumbnails.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Control image dimensions without breaking the link

CSS changes the displayed size; it does not change the clickable relationship:

.gallery-thumb {
  display: block;
  max-width: 100%;
  height: auto;
}

<a href="images/photo-large.jpg">
  <img class="gallery-thumb" src="images/photo-thumb.jpg" alt="View the full-size photo">
</a>

Keeping the image responsive prevents overflow on narrow screens while leaving the full anchor area active.

Complete examples

A local gallery card

<article>
  <a href="/gallery/summer.html">
    <img src="/images/summer-thumb.jpg" alt="Open the summer photo gallery">
  </a>
  <h2>Summer gallery</h2>
</article>

An external logo link

<a href="https://developer.mozilla.org/" target="_blank" rel="noopener">
  <img src="images/mdn-logo.jpg" alt="Visit MDN Web Docs in a new tab">
</a>

A thumbnail that opens the original file

<figure>
  <a href="images/landscape-original.jpg">
    <img src="images/landscape-thumb.jpg" alt="View the full-size landscape photo">
  </a>
  <figcaption>Mountain landscape</figcaption>
</figure>

Common mistakes and fixes

  • The image is not clickable: Check that <img> is actually between the opening and closing <a> tags and that no overlay element is covering it.
  • The wrong page opens: Inspect href for a spelling, slash, protocol, or filename error. Relative paths are resolved from the current document’s folder.
  • The image is broken: Verify the src path, filename capitalization, extension, and server location. A broken image can still have an anchor around it, but visitors cannot see the intended target.
  • The link opens a blank or unexpected tab: Remove target="_blank" if a new tab is not intended, and check that the destination URL is complete.
  • Screen readers announce an unhelpful link: Replace generic alt text with the destination or action. If visible text already names the destination and the image is redundant, use alt="".
  • A fake link does nothing: Replace href="#" or javascript:void(0) with a real URL, or use a button for an in-page action.
  • Keyboard users cannot tell where they are: Restore the anchor’s focus outline or provide a high-contrast :focus-visible style.

Test the image link before publishing

  1. Load the page and click the visible JPG, not just nearby text.
  2. Activate the same link with the keyboard: tab to it and press Enter.
  3. Confirm the final URL, fragment, or downloaded file is the one specified by href.
  4. Resize the viewport and check that the image remains visible and comfortably clickable.
  5. Temporarily block or rename the JPG and verify that the alternative text still explains the destination.
  6. If using a new tab, confirm that the accessible wording tells users what will happen.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup:

If your goal is to generate a clean screenshot of a page rather than hand-build a browser capture workflow, ScreenshotNeo provides a website screenshot API and MCP server. It is separate from the HTML link itself: use the anchor pattern above when you need a clickable JPG on your site, and use ScreenshotNeo when you need an image or PDF capture of a URL.

A single GET request can capture a page. The API accepts the URL and returns PNG, JPEG, WebP, or PDF output. Its cleanup step accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

See the ScreenshotNeo documentation for the full parameter list. This is a runnable cURL example:

Best Value
Sale
IMEASON Swivel Design 16GB USB Flash Drive with Keychain, USB 2.0 Portable Thumb Drive Memory Stick, FAT32 Format Flashdrive for Data Storage, Photos, Music, Files (Black, 16 GB)
  • 【16GB Flash Drive】USB flash drives with 16GB capacity, meet your needs of daily use on work, school, home and travelling for photos, music, videos, files storage and transfer. IMEASON thumb drives can be used to store different files, easy to data backup.
  • 【Metal Swivel Cap Design】USB thumb drive is metal swivel cover provides extra protection for the usb thumbdrive connector, no usb drive cap to lose; keychain design makes it easier to carry without worrying lose it.
  • 【Wide Compatibility】USB drive supports Windows 7/8/10/11 / Vista / XP / Unix / 2000 / ME / NT Linux and Mac OS, also Supports USB 2.0 and 1.1 ports. USB Stick support TV, desktop, notebook computer, car, audio and other device. The USB Memory Stick is your great data storage and transfer companion with traveling and working.
  • 【Easy to use】usb memory stick is plug and play without any software installation. Just simply plug the Flashdrive into the port of your USB-compatible devices such as computer, laptop to start data storage or transmission.
  • 【What You Get】16 GB USB Flash Drive Thumb Drive, The default format of the usb storage flash drive is FAT32.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

For AI workflows, its MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients. The Free plan includes 1,000 screenshots each month with no card; paid plans start at $5 for 3,000 shots. Sign up for the free plan if that capture workflow is what you need.

Frequently asked questions

Can I make only part of a JPG clickable?

Not with a single ordinary anchor around the image. Use separate image slices or an image-map technique when different regions must lead to different destinations; otherwise link the complete image.

Does the JPG format affect whether the link works?

No. The browser applies the anchor behavior to the image element regardless of whether the file is JPG, PNG, WebP, or another supported format. The file must still load correctly through src.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Should I put visible text inside the anchor too?

You can. If the text and image communicate the same destination, keep the image’s alt empty to avoid repeating the link name to screen readers. If the image carries the only meaningful label, give it descriptive alternative text.

Frequently Asked Questions

Can I make only part of a JPG clickable?

Not with one ordinary anchor around the image. Use separate linked elements or an image-map approach when regions need different destinations.

Does the JPG format affect whether the link works?

No. The anchor works with JPG and other supported image formats; the file must simply load from the src path.

Should visible text and the image share one link?

They may. When both convey the same destination, use alt="" on the redundant image so assistive technology does not announce the link twice.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.