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

292
Visualizações
Why does -webkit-box-reflect disturb the normal behavior of the z-index of the pseudo element ::after?

Without -webkit-box-reflect placed on the container everything works as expected (:: after is behind the container element due to the z-index: -1), but when I add it, something strange starts to happen. The pseudo element is still behind the text, button and input element, but not behind the container ("not behind the background color"). Does anyone know why this is happening? Would help a lot!

Here is the code: https://jsfiddle.net/2ntadghb/10/

HTML:

<div class="container">
   Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolor, exercitationem?
   <button>
     click it
   </button>
   <input type="text">
</div>

CSS:

.container {
  width: 200px;
  height: 200px;
  border: 1px solid black;
  background-color: #151515;
  margin: 20px auto;
  position: relative;
  color: white;
  
  -webkit-box-reflect: below;
}

.container::after {
  content: '';
  width: 100px;
  height: 100px;
  display: inline-block;
  background-color: red;
  position: absolute;
  z-index: -1;
  top: 0;
  left: 0;
}
about 4 years ago · Santiago Trujillo
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