To make selected WordPress images fade when a visitor points to them, assign those Image blocks a class such as image-fade, then add a matching CSS rule in your site’s custom CSS area. The example below fades the image to 60% opacity over 0.4 seconds and disables the transition for visitors who request reduced motion.
Add the class to each image
- Open the page or post in the WordPress editor.
- Select the core Image block you want to animate.
- In the block settings sidebar, expand Advanced.
- Enter
image-fadein Additional CSS Class(es), then update or publish the page.
WordPress documents this field for adding a class to an individual block. Applying the class only to chosen images keeps the effect off other images on the site. See the Image block documentation and the Additional CSS classes guide.
Add the fade CSS
Place this CSS in a site-wide custom CSS editor, then save it:
.image-fade img {
transition: opacity 0.4s ease;
}
@media (prefers-reduced-motion: no-preference) {
.image-fade img:hover {
opacity: 0.6;
}
}
The transition declaration makes the opacity change gradual. When the pointer leaves, the hover rule no longer applies and the image returns to its normal opacity. The selector targets the img inside the class-bearing Image block rather than every image on the site. Core Image blocks use an image inside a .wp-block-image figure; if your rendered markup differs, inspect it and adjust the selector. WordPress explains the block structure in its Image block reference.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →#1 Best Overall
- 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 values above are starting values, not a guarantee for every theme or plugin. For a subtler effect, try a higher opacity such as 0.8; for a longer or shorter fade, change 0.4s.
Choose where to enter the CSS
| Location | Best use | Scope and persistence |
|---|---|---|
| Site Editor → Styles → Additional CSS | Block themes with the Site Editor | Site-wide CSS for the active theme. WordPress has documented this interface since version 6.2; it is removed when you switch themes. |
| Customizer → Additional CSS | Classic themes or sites that still expose the Customizer | Site-wide CSS; the exact menu location depends on the active theme and WordPress setup. |
| Styles → Blocks | A rule intended for a block type | Useful when the active theme provides per-block-type styling controls. |
| Theme-level stylesheet or custom CSS facility | Administrators maintaining theme code | Use the theme’s documented method and account for theme updates; a child theme or supported custom CSS mechanism avoids editing parent-theme files directly. |
WordPress describes these interfaces and their limitations in the Styles overview and its CSS administration documentation. The Customizer has supported custom CSS since WordPress 4.7, but it may be hidden when a theme uses the Site Editor.
Make the effect work with galleries, builders, and custom markup
This recipe assumes a core Image block. A gallery block, page builder, theme component, or image plugin may put the class on a different element or wrap the image differently.
Rank #2
- 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
- Open the published page in a browser.
- Right-click the image and choose Inspect (or use your browser’s developer tools).
- Find the element carrying
image-fadeand identify the actual image element. - Change the selector accordingly—for example, target a nested link or the builder’s image element—while keeping the class specific enough not to affect unrelated images.
If the image is linked, fading the image itself preserves the link and its keyboard behavior. Do not remove focus styles or make the link indistinguishable from a disabled control.
Respect reduced-motion and touch input
The prefers-reduced-motion: no-preference condition means the hover transition is supplied only when the visitor has not requested reduced motion in the operating system or browser. Without that condition, animated opacity changes can be uncomfortable for some people. WordPress recommends honoring this preference in its animation guidance.
Touchscreens do not provide a conventional mouse hover. Treat the fade as visual decoration, not the only way to reveal a label, convey a status, or operate an image button. Provide visible text, an accessible name, or another tap and keyboard interaction for information or controls that matter.
Rank #3
- 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)
Troubleshoot a fade that does not appear
The class is missing or misspelled
Reopen the Image block’s Advanced → Additional CSS Class(es) field and confirm it contains exactly image-fade, with no punctuation or leading period.
The CSS is in the wrong editor
Confirm that you saved the CSS in an area that accepts complete selectors and declarations. Some block-level controls accept declarations only and do not want a selector with braces. If Additional CSS is unavailable, the active theme or your account may not expose it; check the theme’s documentation and your WordPress permissions.
The selector does not match the front end
Inspect the published markup. This example expects the class-bearing wrapper to contain an img. A builder or plugin may require a different descendant selector.
Rank #4
- Computer mouse for easily navigating a computer interface; click, scroll, and more
- USB-A wired connection; if existing device only supports USB-C, an additional adapter will be required
- High-definition (1000 dpi) optical tracking ensures responsive cursor control for precise tracking and easy text selection
- 3 buttons offer effortless fingertip control
- Plug-and-go ready for instant use
A theme rule overrides the opacity
In developer tools, check which rule sets opacity. If another rule wins, make your selector more specific or place the rule in the theme’s supported custom CSS area. Avoid adding !important unless you have confirmed that it is necessary and understand the maintenance cost.
The editor preview looks unchanged
Test the saved page on the front end, clear any page or browser cache, and verify that the CSS file or style panel is loading. Editor previews can use markup or styles that differ from the published page.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Use a different fade design when appropriate
Fade only while hovering
The supplied rule is the usual choice: the image dims on pointer hover and returns when the pointer leaves.
Free tools Windows power users keep installed
One-click scans. No signup required.
Best Value
- 【Plug and Play for Home/Office/School】The wireless computer mouse features 2.4GHz connectivity, delivering a stable, interference-free connection up to 32ft. Designed for 𝐦𝐞𝐝𝐢𝐮𝐦 𝐭𝐨 𝐥𝐚𝐫𝐠𝐞 𝐬𝐢𝐳𝐞𝐝 𝐡𝐚𝐧𝐝𝐬, it ensures comfortable use all day. Simply plug in the USB-A receiver for instant pairing—no drivers needed. 📌📌 If the mouse isn’t suitable, place the USB receiver in the battery compartment and return both.
- 【3 Levels Adjustable DPI】This travel USB mouse offers 3 adjustable DPI settings (800, 1200, 1600), allowing you to customize sensitivity for precise design work. Effortlessly switch to match your task and elevate your productivity. 📌 Please remove the film at the bottom of the mouse before use.
- 【Effortless Browsing】Equipped with forward and backward buttons, this computer mice streamlines your workflow, making it easy to navigate through web pages and files with a simple click. 📌Side button does not work on Mac.
- 【Visible Indicator Light】 The pc mouse features a visual indicator for DPI levels and low battery alerts. The red light flashes once for 800 DPI, twice for 1200 DPI, and three times for 1600 DPI. When the battery level is below 10%, the light flashes red until the mouse is completely out of power.
- 【Click to Wake】With smart sleep mode, it saves power by standby after 10 inactive minutes, just 2-3 clicks to wake. This efficient design delivers 3x longer battery life than motion-wake mice. Engineered for durability, its buttons and scroll wheel are tested for 10 million clicks, ensuring long-term reliability and consistent performance.
Keep the image fully visible and reveal an overlay
If dimming harms readability, retain the image opacity and reveal a caption or icon in a positioned overlay. Make that content available to keyboard and touch users as well; hover alone is not an accessible interaction.
Apply the effect to every image
A global selector such as .wp-block-image img:hover would affect all core Image blocks, but it is harder to control and may unintentionally animate logos, content images, or interface graphics. A custom class is safer for a selected set.
Quick Recap
What to check before publishing
- Only the intended Image blocks have the
image-fadeclass. - The CSS is saved in an editor available to your theme and account.
- The published markup contains the element targeted by the selector.
- The image remains usable as a link or button with keyboard and touch input.
- Important information is not communicated only by the fade.
- The reduced-motion condition is present if you use a transition.
- You have tested the result at normal and narrow viewport widths.
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.

