How to Add Image Zoom on Hover in Squarespace
A little movement can make an image feel more interactive without changing the whole page. If you want a photograph to enlarge slightly when someone moves their cursor over it, a Squarespace image zoom on hover effect is a simple customization to try.
It can work nicely on selected portfolio images or images that link to another page. The key is to keep the movement consistent and avoid making every visual compete for attention.
In this guide, you’ll learn how to apply the effect to one image block, reuse it on several images, and adjust the zoom to suit your design. You won’t need to install a website plugin.
Does Squarespace Have a Built-In Image Zoom Effect?
Squarespace does offer built-in zoom options in some places, including product details pages and certain portfolio layouts. The available settings depend on the type of content you’re editing. Product image zoom, portfolio styling options.
This tutorial focuses on applying your own CSS hover effect to specific image blocks. It is not a universal snippet for product images, gallery sections, or section backgrounds.
If the content you’re working with already offers a suitable zoom setting, try that option first.
Step 1: Find Your Image Block ID
To apply the effect to one image, you need the ID of its image block.
Use the Squarespace ID Finder browser extension to locate and copy the block ID. It helps identify Squarespace elements without manually searching through the page code.
Choose the image block ID, rather than the ID of the surrounding section. These identify different parts of the page.
For example, a block selector may look like this:
#block-yui_3_17_2_1_1759829328300_4893Your own ID will be different. Keep the # at the beginning when using it in the CSS.
Step 2: Add the Hover Zoom CSS
Open your website’s Custom CSS panel. Back up any existing code, then paste this snippet at the bottom, outside any existing rule.
Replace the example block ID with your own. Paste the CSS without adding HTML <style> tags. Save your changes when finished. Squarespace’s Custom CSS guide.
#block-yui_3_17_2_1_1759829328300_4893 {
img {
transition: 0.1s !important;
}
&:hover img {
transform: scale(1.2) !important;
}
}This is your original nested snippet, formatted for readability. The zoom amount and transition time are unchanged.
Open the page outside editing mode and move your cursor over the image. The image should enlarge while the block is hovered. Existing image settings or custom CSS can affect the result, so check it on your own site.
How Does the Code Work?
The block ID limits the effect to the image block you selected. The img selector targets image elements inside that block.
The &:hover img rule applies while the cursor is over the block. In this snippet, scale(1.2) displays the image at 120% of its untransformed width and height.
The transition: 0.1s declaration makes the change happen over one tenth of a second. That creates a quick response rather than a long animation.
The code visually scales the image; it does not increase its resolution or create a magnifying glass. It also does not add a link. If you want the image to lead somewhere, configure its destination separately.
Step 3: Apply the Effect to Multiple Images
To use the same effect on several image blocks, group their IDs with commas.
Replace each placeholder below with an actual image block ID:
#block-ID1,
#block-ID2,
#block-ID3 {
img {
transition: 0.2s !important;
}
&:hover img {
transform: scale(1.2) !important;
}
}This version keeps the 20% enlargement and uses the 0.2-second transition from your original multiple-image example.
Each block responds when you hover over it. Hovering over one does not trigger all three.
Use either the single-image rule or the grouped rule for a particular image. Avoid including the same block in both if you want to keep its styling easy to manage.
Step 4: Adjust the Zoom and Speed
Once the effect is working, you can make small changes to match your website.
For a gentler zoom, change scale(1.2) to scale(1.05) or scale(1.1). These enlarge the image by 5% or 10% in each dimension.
The right amount depends on the photograph and its crop. A close-up portrait may need less movement than an image with plenty of space around the subject.
For a slower transition, change 0.1s or 0.2s to 0.3s. Apply the same timing to similar images so the interaction feels consistent across the page.
Optional refinement: If you want the transition to apply specifically to the transform, you can replace the transition line with:
transition: transform 0.3s ease !important;This is an optional adjustment, not part of the original snippet above.
What Happens on Mobile?
Touchscreens do not offer the same dependable hover interaction as a mouse. Some devices may simulate hover after a tap, while others behave differently. MDN’s explanation of hover behavior.
The supplied code has no desktop-only restriction. Test it on your phone, particularly if the image is also a link, and check that tapping still takes visitors where they expect.
Treat the zoom as decoration. Visitors should be able to understand the image and use any associated link without seeing the animation.
Common Issues to Check
1. The Image Is Not Zooming
Confirm that you copied the correct image block ID, included the initial #, and saved your CSS. Check for missing braces or errors in earlier code too.
If the selector is correct, another image effect or custom rule may be competing with the transform. Test on a duplicate page when investigating conflicts so you can compare the result safely.
2. The Image Extends Beyond Its Frame
The snippet scales the image but does not add a clipping rule. Whether the enlarged edges remain inside the frame depends on the existing image container.
If the image overlaps nearby content, try a smaller scale first. Keeping the zoom within a fixed frame may require overflow: hidden on the appropriate image wrapper. The correct wrapper depends on the block layout, so avoid applying it broadly across the website.
3. The Zoom Feels Too Sudden
Increase the transition duration slightly. Try 0.3 seconds and compare it with the original timing.
You do not need a dramatic animation for the effect to be noticeable. A small zoom with a brief transition is often enough.
Frequently Asked Questions
-
No website plugin is needed. The zoom comes from the CSS snippet you add to your site. The ID Finder is a browser tool that helps you locate the correct block; it does not provide or power the animation.
-
No. When you use specific block IDs, the rules apply only to matching blocks. The grouped example lets you choose several images without targeting the whole website. Double-check each ID if the effect appears on an unexpected block.
-
Not automatically. Those images can use different structures and settings. This tutorial targets ordinary image blocks. Check built-in controls for your product or portfolio layout, and use code written for the specific content type if a custom effect is needed.
-
A small hover zoom can draw attention to a photograph, but it is not a full image viewer. If people need to examine your work more closely, a lightbox may be more useful: it opens an image in an overlay when clicked. Squarespace’s lightbox guide.
-
Delete the snippet you added and save your changes. Leave unrelated CSS in place. Refresh the page and check the image again; its appearance will then depend on the remaining site styles and image settings.
Final Thoughts
A hover zoom effect is a small detail, but it can bring a little more movement to a page. Choose the images that benefit from it, keep the enlargement modest, and check how the effect looks alongside the rest of your design.
The most useful finishing touches are the ones that fit naturally. Your images should still look good, communicate clearly, and work as expected when the animation is not available.
Building or improving a Squarespace website? Book a free call with me to discuss your website, goals, and the improvements you have in mind. Whether you need a few custom design touches or a complete redesign, I can help you create a professional Squarespace website that reflects your brand and encourages visitors to take action.