Lecture 8
Lecture 8
Mirzoulugbek Yusupov
What is CSS Grid?
• CSS Grid is a two-dimensional layout system for the web.
• grid-row-start
• grid-column-start
• grid-row-end
• grid-column-end
• The grid-area property can also be used to assign a name to a grid item. Named grid items can
then be referenced to by the grid-template-areas property of the grid container. See examples
below.
• These properties control the alignment of grid items inside their grid cells:
• justify-items: Aligns items horizontally (left, center, right).
• align-items: Aligns items vertically (top, center, bottom).
• Values
• start: Aligns items at the start.
• center: Centers items.
• end: Aligns items at the end.
• stretch (default): Stretches items to fill the grid cell.
justify-content & align-content
• These properties control the alignment of the entire grid within the container:
• justify-content: Aligns the grid horizontally.
• align-content: Aligns the grid vertically.
• Values:
• start: Aligns the grid at the start.
• center: Centers the grid.
• end: Aligns the grid at the end.
• space-between: Spreads items evenly, with no space at the edges.
• space-around: Spreads items evenly, with space around them.
• space-evenly: Spreads items evenly, with equal space between and around.
place-items & place-content