Skip to content

Instantly share code, notes, and snippets.

@teffcode
Created June 22, 2020 02:14
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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



@juli6464
Copy link

juli6464 commented Oct 6, 2021

Good quiz

@josetk89
Copy link

Interesting quiz!!!
Instantly I remember your class.

@eliabjselvacruz
Copy link

eliabjselvacruz commented Feb 17, 2022

Option A.

@AngelRaf23
Copy link

Amazing exmple! 🤩

@Facu3071
Copy link

Great example.

@Gerardo-RG
Copy link

Gerardo-RG commented Feb 26, 2022

Opción A

@adrianlrx
Copy link

Option A

@Alvaro-Hernandez
Copy link

Option A

@Johan-Palacios
Copy link

A

@estuardolofish
Copy link

A

@OmairaBarrera
Copy link

Opcion A

@91martillos
Copy link

Good one!

@julianandrescaracas0623

OPCIÓN A

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