Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

271
Visualizações
How to prevent overlap between elements of different z-index positions across several layers?

I understand in general we place individual elements one on top of the other with different positions, many times to give an illusion of two or more elements that are separated to look like a single component. But, is there a property in CSS that could make a higher position element prevent all the other elements behind it to display the overlap and just between a specific depth range?

Just to give more context here, I'm making a dynamic pie, each element is independent, including the center. The page has a lot of dynamism, water effects on the background, fog at the top, background picture, etc. Everything has different depths, but among all of them, I want to remain the center of the pie "untouched" by everything displayed at the back of it, while keeping a transparent background. One thing I've been struggling with a lot is removing the background color when hovering over a pie-children.

As you can see in the attached picture, the center of the pie and all individual children have a transparent background. The center of the pie has a higher z-index than the children, hence when a child is hovered its background overlaps with the center of the pie. I have applied a transparent background gradient to the pie children to remove the overlap, but because it's a dynamic pie it only works for a 4 element pie. When the pie has less or more than 4 elements, the angle of the background gradient becomes disproportional.

Please consider the background gradient is just one example, I also want to display a box-shadow in each child. The box-shadow, as well as the background color, need to be removed from the center of the pie, but the water effect happening at the top of the background picture needs to continue running.

Fiddle -> https://jsfiddle.net/jsandler/u34r8x9d/25/

Pie children CSS

.pie-children:hover {
    /* box-shadow: 0px 0px 30px 10px rgba(255, 255, 255, 0.2) inset, 0px 0px 30px 10px rgba(255, 255, 255, 0.2); */
    background-color: rgba(255, 255, 255, .15);
    backdrop-filter: blur(5px);
    text-shadow: 0px 0px 5px rgba(255, 255, 255, 0.8);
    /* background-image: radial-gradient(farthest-corner at 0% 100%, transparent 0 25%, rgba(255, 255, 255, .15) 25% 100%); */
    cursor: pointer;
}

enter image description here

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda