Assessment wanted for Grid layout 1 skill test (The Additional Question)

I have completed second the assessment where you have to display the second item on the top of the first one, but I have a problem with the additional question. How do you make the first item to stay on top. Really tricky. I saw someone doing “z-index: 1;”. Is there any other solution to this?

Hi @Jalaladdin_Rafiyev and welcome to the community :wave:

Although z-index: 1; is a valid solution the “grid way” to do it would be: order: 1; on .item1. The order property is used in flex and grid container to change the visual order of elements. I recommend reading the linked article since there are some accessibility concerns when using this property in a real project.

two side notes:

  • Is there a specific reason you used negative numbers in grid-row and grid-column?
  • Since embedding iframes is not possible on this forum I recommend just posting a link to CodePen for any further questions/tasks. Like this: https://codepen.io/jalaladdinrafiyev/pen/WNOwjzR

I hope that helps! Feel free to ask more questions. I’m happy to help :slightly_smiling_face:

Happy Coding!
Michael

1 Like