This is a task:“https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Grid_skills#grid_layout_two ”
It has a supplementary question under this task:" Can you now cause the first item to display on top without changing the order of items in the source?"
.grid {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
grid-template-rows: 100px 100px 100px;
gap: 10px;
}
.item1 {
grid-column: 1/4;
grid-row: 1/3;
}
.item2 {
grid-column: 2/5;
grid-row: 2/4;
}
I don’t know.Can you help me?
Hello @zhao19940701
what about using this https://developer.mozilla.org/en-US/docs/Web/CSS/z-index
it would be better if you post your code on any online service in your future post
hope that help and have a nice day
2 Likes
mikoMK
(Michael Koch)
September 9, 2021, 7:59am
3
Especially for grids an flexboxes there is also:
This is also a possibility to solve the supplementary question.
Cheers!
Michael
2 Likes
you welcome and thanks you too
Thank you.Good luck!Michael.
1 Like
hyman
(hyman)
September 9, 2021, 3:43pm
7
.item1 {
grid-column: 1/4;
grid-row: 1/3;
order: 1
}