Software⏱️ 2 min read📅 2026-05-31

How to Fix: CSS transition with visibility not working

CSS transition with visibility not working due to incorrect usage of the 'visibility' property. The issue is resolved by using the 'opacity' property instead.

Quick Answer: Use opacity for transitions, as visibility can cause issues with hover effects and delay on out events.

The issue you're experiencing with CSS transitions on visibility and opacity is due to the browser's interpretation of the transition property. In your case, both Chrome and Firefox are interpreting the transition time as a delay on hover out.

🔍 Why This Happens

  • The transition property is not supported for the visibility and opacity properties. Instead, you can use the CSS 3 transitions on the opacity property, while setting the visibility to 'visible' or 'hidden' directly.

🔧 Proven Troubleshooting Steps

Method 1: Using Opacity Transition

  1. Step 1: Replace the visibility property with opacity and set the transition to opacity.

Method 2: Using Visibility Property

  1. Step 1: Use the CSS 3 transitions on the opacity property and set the visibility to 'visible' or 'hidden' directly.

✨ Wrapping Up

To fix your issue, you can use either of the methods above. For example, in Case 1, replace the visibility property with opacity and set the transition to opacity:

#inner{ opacity:0; transition:opacity 1000ms;}

Then, update the hover state as follows:

#outer:hover #inner{ opacity:1; visibility:visible; }

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions