CSS grid-row-start Property
Subject: css
CSS grid-row-start Property
The grid-row-start property in CSS Grid is used to define the starting row line of a grid item. It helps control where the item is placed vertically inside the grid layout. Often used with grid-row-end, this property provides exact placement flexibility.
Why Use grid-row-start?
- Precisely position elements on the vertical axis
- Control layout structure without extra wrappers
- Create advanced designs like dashboards, calendars, or news grids
- Reorder visual elements independently of HTML structure
Syntax
Values:
<line number>: A positive integer that refers to a row line (starts at 1)auto: Default; lets the browser automatically place the item
Example: Using grid-row-start
Explanation
.item1starts at row line 2.item2starts at row line 4- Remaining items auto-fill the grid in the next available spots
Best Practices
- Use for fine-tuned vertical placement within a grid
- Combine with
grid-row-endto define span - Ensure clear grid structure when manually positioning
- Avoid confusing visual overlap in complex layouts
Common Use Cases
- Custom row placement in dashboards
- Overlapping or offset content blocks
- Modular card layouts
- Calendars, pricing tables, or structured forms
Key Takeaways
grid-row-startsets the vertical start line of a grid item- Use with line numbers or
auto - Combine with
grid-row-endfor row span - Works only within
display: gridcontainers - Helps build flexible, non-linear layouts
Advertisement Slot 1
Advertisement Slot 2