VOOZH about

URL: https://www.geeksforgeeks.org/css/css-justify-self-property/

⇱ CSS justify-self Property - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

CSS justify-self Property

Last Updated : 23 Jul, 2025

The justify-self property aligns a grid item within its grid cell in the inline direction, which is typically left to right for English pages. It requires available space around the item in the inline direction to have an alignment effect.

Syntax:

justify-self: stretch | normal | auto | baseline | start | end | center | flex-start | 
flex-end | self-start | self-end | left | right | safe | unsafe;

Property Values:

ValueDescription
stretchDefault value. Content fills the whole width of the cell.
normalBehaves as 'start' in block-level layouts. Ignores in table and flex layouts. Acts as 'stretch' in other absolutely positioned boxes.
autoDefault value. Used if justify-items property is located in parent element or defaults to normal value.
baselineAligns the alignment baseline of the current box’s first or last baseline with corresponding baseline in shared first or last baseline set of all the boxes.
startAligns content to the left of the cell.
endAligns content to the right of the cell.
centerAligns content to the center of the cell.
flex-startSame as 'start' value.
flex-endSame as 'end' value.
self-startAligns the item to the left of the aligned container at the beginning of an item.
self-endAligns the item to the right of the aligned container at the end of an item.
leftMakes the item pack flush to the left of the alignment container.
rightMakes the item pack flush to the right of the alignment container.
safeAligns as 'start' if item overflows the alignment container.
unsafeAligns as the given value regardless of relative sizes of alignment container and item.

Example 1: In this example, justify-self is not used for the alignment.

Output:

👁 Image

Example 2: In this example, a few of the justify-self values are used for the alignment.

Output:

👁 Image

Supported Browsers:

Comment