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

Add a hover effect to a WordPress image by giving its Image block a custom CSS class, then styling that class with a CSS :hover rule. This scopes the effect to the image you choose rather than changing every image on your site.

Choose a method: custom CSS or a plugin

Approach Best when What to know
Custom CSS You want to target specific images and control the effect directly. Requires a place to add CSS and basic comfort editing it. WordPress supports custom CSS in Styles and, for some blocks, per-block CSS controls; available options depend on the theme and setup. WordPress Styles overview
Block Style Modifiers plugin You prefer choosing hover styles through editor controls. The plugin listing describes hover effects for Image, Cover, and Media & Text blocks, and says its default modifiers are disabled when reduced motion is preferred. The listing does not establish compatibility with every theme or installation. Block Style Modifiers listing

Add a targeted zoom effect with CSS

  1. In the WordPress editor, select the Image block you want to style.

  2. Open the block’s Advanced settings and enter my-image-hover in Additional CSS class(es). Do not include a leading period. This field adds a class you can target with custom CSS. WordPress Advanced Settings overview

  3. Add this CSS in the site-wide custom CSS editor in Styles, or in an appropriate stylesheet:

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
    #1 Best Overall
    Sale
    Logitech M185 Compact Ambidextrous 2.4 GHz Wireless Mouse - Swift Grey
    • Compact Mouse: With a comfortable and contoured shape, this Logitech ambidextrous wireless mouse feels great in either right or left hand and is far superior to a touchpad
    • Durable and Reliable: This USB wireless mouse features a line-by-line scroll wheel, up to 1 year of battery life (2) thanks to a smart sleep mode function, and comes with the included AA battery
    • Universal Compatibility: Your Logitech mouse works with your Windows PC, Mac, or laptop, so no matter what type of computer you own today or buy tomorrow your mouse will be compatible
    • Plug and Play Simplicity: Just plug in the tiny nano USB receiver and start working in seconds with a strong, reliable connection to your wireless computer mouse up to 33 feet / 10 m (5)
    • Better than touchpad: Get more done by adding M185 to your laptop; according to a recent study, laptop users who chose this mouse over a touchpad were 50% more productive (3) and worked 30% faster (4)
    .my-image-hover img {
      transition: transform 0.25s ease;
    }
    
    .my-image-hover:hover img {
      transform: scale(1.05);
    }
    
    @media (prefers-reduced-motion: reduce) {
      .my-image-hover img {
        transition: none;
      }
    }

    The class limits the selector to blocks you assign it to. The core Image block wrapper uses .wp-block-image, but the custom class avoids styling every image. WordPress Image block reference Block Stylesheets handbook

  4. Save the CSS and preview the page. Move a mouse pointer over the image to check the zoom; also test the page on a touch device and with keyboard navigation if the image or its surrounding content is interactive.

    Rank #2
    Sale
    Logitech G305 Lightspeed Wireless Gaming Mouse - Black
    • The next-generation optical HERO sensor delivers incredible performance and up to 10x the power efficiency over previous generations, with 400 IPS precision and up to 12,000 DPI sensitivity
    • Ultra-fast LIGHTSPEED wireless technology gives you a lag-free gaming experience, delivering incredible responsiveness and reliability with 1 ms report rate for competition-level performance
    • G305 wireless mouse boasts an incredible 250 hours of continuous gameplay on just 1 AA battery; switch to Endurance mode via Logitech G HUB software and extend battery life up to 9 months
    • Wireless does not have to mean heavy, G305 lightweight mouse provides high maneuverability coming in at only 3.4 oz thanks to efficient lightweight mechanical design and ultra-efficient battery usage
    • The durable, compact design with built-in nano receiver storage makes G305 not just a great portable desktop mouse, but also a great laptop travel companion, use with a gaming laptop and play anywhere

Adjust the zoom and clipping

The example scales the image to 1.05 of its original size. A subtler value such as 1.03 may fit a tight layout better. If the enlarged image is clipped, inspect the image and its parent for an overflow rule; adjust the wrapper or remove the zoom if clipping cuts off important content.

Where to put the CSS

WordPress documents both site-wide custom CSS in Styles and per-block CSS options. Controls vary by theme and setup. In a per-block CSS field, follow the format that editor requests: some fields accept only property/value declarations, while a selector-based hover rule needs a place that accepts full CSS selectors. WordPress Styles overview

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.
Rank #3
Sale
Logitech M185 Compact Ambidextrous Wireless Mouse with Rubber Grips - Blue
  • Compact Mouse: With a comfortable and contoured shape, this Logitech ambidextrous wireless mouse feels great in either right or left hand and is far superior to a touchpad
  • Durable and Reliable: This USB wireless mouse features a line-by-line scroll wheel, up to 1 year of battery life (2) thanks to a smart sleep mode function, and comes with the included AA battery
  • Universal Compatibility: Your Logitech mouse works with your Windows PC, Mac, or laptop, so no matter what type of computer you own today or buy tomorrow your mouse will be compatible
  • Plug and Play Simplicity: Just plug in the tiny nano USB receiver and start working in seconds with a strong, reliable connection to your wireless computer mouse up to 33 feet / 10 m (5)
  • Better than touchpad: Get more done by adding M185 to your laptop; according to a recent study, laptop users who chose this mouse over a touchpad were 50% more productive (3) and worked 30% faster (4)

The Image block’s Additional CSS class(es) field is for naming the block to target; it is not necessarily the place to paste the full stylesheet. The Advanced settings documentation also describes an Additional CSS input for some blocks, available only to users with the edit_css capability. WordPress Advanced Settings overview If the relevant controls are missing, ask your site administrator or use the stylesheet workflow supported by your theme. Avoid editing a parent theme file that an update could overwrite.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose an effect that remains accessible

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.