CSS Grid Items - Order
Set the Visual Order of the Grid Items
The CSS order property can be used to
define the visual order of the grid items.
The first grid item in the HTML source code does not have to appear as the first item in the grid container.
Example
Set the visual order of the grid items:
.item1 {order: 3;}
.item2 {order: 6;}
.item3 {order: 1;}
.item4
{order: 2;}
.item5 {order: 4;}
.item6 {order: 5;}
Result:
Accessibility note: The order
property provides visual reordering, but it does not change the logical order of
elements in the DOM. This will affect users navigating the site with assistive
technologies like screen readers, as the content will be read in a different
order than it is visually presented.