i have one parent div , inside the parent div i have 3 children divs.
<div class="parent">
<div class="child1">First</div>
<div class="child2">Second</div>
<div class="child3">Third</div>
</div>
For parent i already write below style.
.parent {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
}
Expectation is
Second First Third
3
Answers
You can use the css order property:
For example by putting
order: -1
the item will be placed at the beginingWorking example below
Use the
order
parameter on the children:In addition to the
order
CSS property, you can also use thegrid-template-areas
property on the parent andgrid-area
property on the children if you prefer to use a label for the ordering rather than a number.