bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/CSS/Modern Layout
CSS•Modern Layout

CSS Grid Items - Alignment

Flash cards

Review the key moves

1/4
Core idea

What is the main idea behind CSS Grid Items - Alignment?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

2Fill blank

Complete the missing token from the example code.

___-self
3Order

Put the learning moves in the order that makes the concept easiest to apply.

The CSS align-self Property
The CSS justify-self Property
CSS Grid Items - Alignment

Grid items can be aligned within their respective grid cells using properties like:

  • justify-self - Specifies the horizontal alignment within a cell
  • align-self - Specifies the vertical alignment within a cell
  • place-self - Shorthand property for align-self and justify-self

These can also be applied to all grid items in a container using justify-items and align-items on the grid container.

The CSS justify-self Property

The justify-self property is used to align a grid item within its grid cell in the inline direction.

Tip

For pages in English, inline direction is left to right and block direction is top to bottom.

This property can have one of the following values:

  • auto (default)
  • normal
  • stretch
  • start
  • left
  • center
  • end
  • right

Note

For this property to have any alignment effect, the grid item need available space around itself in the inline direction.

justify-self

The CSS align-self Property

The align-self property is used to align a grid item within its grid cell in the block direction.

This property can have one of the following values:

  • auto (default)
  • normal
  • stretch
  • start
  • end
  • center

Note

For this property to have any alignment effect, the grid item need available space around itself in the block direction.

align-self

CSS Grid Item Alignment Properties

PropertyDescription
align-selfAlign a grid item within its grid cell in the block direction
justify-selfAlign a grid item within its grid cell in the inline direction
place-selfA shorthand property for align-self and justify-self

Previous

Responsive Web Design - Templates

Next

CSS Grid Items - Order