Menu

gitpiper

Sibling fade css Code Snippet in 2025

interactivityintermediate

Last Updated: 25 April 2025

Fades out the siblings of a hovered item.

  • Use a transition to animate changes to opacity.
  • Use the :hover and :not pseudo-class selectors to change the opacity of all elements except for the one the mouse is over to 0.5.
<div class="sibling-fade"> <span>Item 1</span> <span>Item 2</span> <span>Item 3</span> <span>Item 4</span> <span>Item 5</span> <span>Item 6</span> </div>
span { padding: 0 16px; transition: opacity 0.3s; } .sibling-fade:hover span:not(:hover) { opacity: 0.5; }

css snippet similar to Sibling fade For You in April 2025

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️

© 2025 GitPiper. All rights reserved

Rackpiper Technology Inc

Company

About UsBlogContact

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️