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.
📋 Table of Contents
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
- Step 1: Replace the visibility property with opacity and set the transition to opacity.
Method 2: Using Visibility Property
- 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; }❓ Frequently Asked Questions
🛠️ Related Fixes
How to Fix: Pc crashes shortly after launching game (rainbow
Pc crashes shortly after launching game, possible cause: outdated grap
How to Fix: Installing an APK on a locked down phone
Installing an APK on a locked down phone: Try using a rooted device, e
How to Fix: FPS drops
FPS drops in games can be caused by high system resource usage, outdat