Skip to content

Instantly share code, notes, and snippets.

@teffcode
Created June 22, 2020 02:14
Show Gist options
  • Save teffcode/e0b3e89df22ecf5374527deaf31b11ca to your computer and use it in GitHub Desktop.
Save teffcode/e0b3e89df22ecf5374527deaf31b11ca to your computer and use it in GitHub Desktop.

馃憢馃徏 Welcome 馃憢馃徏

Quiz banner

Instagram | Twitter | LinkedIn


Choose your language 馃憛



English version 馃殌


Consider the following code:

CSS HTML

What would you see in the browser ?




Click here to see the correct answer and explanation 馃憖
Correct Answer Explanation
A 馃帀 yellow is rendered under red because red's z-index (5) is valid within the stacking context of the root element, while yellow's z-index (6) is valid within the stacking context of blue. So, yellow is under red, because yellow belongs to blue, which has a lower z-index value. See the code here.

Recommended reading 馃憠馃徏 The stacking context



Spanish version 馃殌


Considera el siguiente c贸digo:

CSS HTML

驴 Qu茅 ver铆as en el navegador ?




Haz click aqu铆 para ver la respuesta correcta y su explicaci贸n 馃憖
Respuesta correcta Explicaci贸n
A 馃帀 yellow es renderizado debajo de red porque el z-index (5) de red es v谩lido dentro del contexto de apilamiento del elemento ra铆z, mientras que el z-index (6) de yellow es v谩lido dentro del contexto de apilamiento de blue. As铆 que yellow est谩 debajo de red, porque yellow pertenece a blue, que tiene un valor z-index menor. Mira el c贸digo aqu铆.

Lectura recomendada 馃憠馃徏 El contexto de apilamiento



@Johan-Palacios
Copy link

A

@estuardolofish
Copy link

A

@OmairaBarrera
Copy link

Opcion A

@martinruizn
Copy link

Good one!

@julianandrescaracas0623

OPCI脫N A

@ContrerasMarco
Copy link

la A pro supuesto porque el contenedor amarillo es hijo del contenedor azul y aunque el contenedor amarillo tenga un valor mas alto que los dos esta amarrado al contenedor azul que es su padre y este tiene un valor menor al contenedor rojo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment