DEV Community

Discussion on: Codecademy - CSS 9: Advanced Grid

Collapse
 
sjellen profile image
SJellen • Edited

“ I tested the z-index value from 1-10 and it always put the image on top - would like to know why this happened if anyone can help please!”

Why did you use z-index at all on the image? The default is 0(I think) so anything over 0 is on top.

A dinner table would be z-index 0
A place mat z-index 1
A plate and silverware would be z-index 2
What’s on the plate would be z-index 3

I think I’m right. But somebody correct me.

Collapse
 
helen8297 profile image
Helen Kent

That's a good way to think about it, thank you!
I used it because that was the instruction in the tutorial - without the z-index property the element was beneath another square. When it was included it was on top but the tutorial said to give it the value of 5, which confused me, because 1-10 did the same thing. Does that make sense?

Collapse
 
sjellen profile image
SJellen

Plus it probably wouldn’t let you advance until it was at exactly at 5.