Site logo

Archived topic

Fading out siblings on hover in CSS

3 replies · Started by Juan on November 26, 2021

Viewing posts 1–4 of 4

I'm trying to replicate this same effect on my website but I can't get around the fact that when the box is enlarged an opacity appears.

This is the CSS code I am using:

/*Efecto fading*/
.parent:hover > * {
  opacity: 0.5;
}

.parent:hover > *:hover {
  opacity: 1;
}

.fade-out-siblings > * {
   cursor: pointer;

  pointer-events: auto;
  transition: 300ms opacity, 300ms transform;
}

.fade-out-siblings:hover > * {
  opacity: 0.5;
  
}

.fade-out-siblings:hover > *:hover {
   transform: scale(1.1);
   opacity: 1;
}

This is my website, where I am trying to implement the

Hi there,

try adding the scale to just the inner container ie. Change this:

.fade-out-siblings:hover > *:hover {
   transform: scale(1.1);
   opacity: 1;
}

to:

.fade-out-siblings:hover > *:hover {
   opacity: 1;
}
.fade-out-siblings:hover > *:hover .gb-inside-container {
    transition: transform 0.3s ease;
    transform: scale(1.1);
}

Works perfect!

Thanks a lot.

Glad to hear that

This archived topic is closed to new replies.