The justify-items property is applied to a grid container to align child elements along the row direction. For this property to have any alignment effect, the elements must have available space around them in the row direction. To align elements along the block direction, use the align-items property. According to the CSS specification, the following values are supported for justify-items:
What about right, left, and other values?
Values such as right, left, baseline, normal, and others are not officially supported for the justify-items property. These values may work (or at least partially) in some browsers due to their experimental nature or legacy versions of the standard, but they are not part of the current CSS Grid specification.
| baseline | The element is aligned to the baseline of the parent. | See example |
|---|---|---|
| center | Aligns the elements to the center. | See example |
| end | Aligns the elements to the end. | See example |
| inherit | Inherits the property from the parent element. | See example |
| initial | Sets to the default value. | See example |
| left | Aligns the elements to the left. | See example |
| legacy | Grid items with the justify-self value inherit the value automatically. | See example |
| normal | Depends on the layout context, but similar to stretch for grid layout. | See example |
| right | Aligns the elements to the right. | See example |
| start | Aligns the elements to the start in the row direction. | See example |
| stretch | Stretches to fill the grid cell if the size in the row direction is not set. | See example |
Thank you for visiting! Adding privacy policy.
© 2024 All rights reserved.
Vam je koda pomagala? Če želite podpreti moj trud pri pripravi vodičev in vzdrževanju strani, mi lahko namenite donacijo za kavo.