CSS Portal

CSS place-self Property

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

Description

The place-self property is a convenient shorthand that sets how a single element is aligned within its containing alignment container along both the inline and block axes. It effectively lets you control an element’s positioning relative to the available space inside the container without having to set each axis separately. Because it maps directly to the two axis-specific alignment properties, it’s commonly used to express an element’s alignment in a single, compact declaration — useful when you want to override the container defaults for one item.

As a shorthand, place-self combines the behaviors of align-self (block-axis alignment) and justify-self (inline-axis alignment). That means you can change how an item is positioned vertically (or along the block axis) and horizontally (or along the inline axis) in one place. If a given layout mode or container does not honor one of those underlying properties (for example, many flex layouts ignore inline-axis alignment for individual items), the corresponding component of the shorthand has no effect while the other component still applies.

How place-self actually affects placement depends on the container’s layout model and its alignment settings. In grid layouts it directly controls a grid item’s alignment inside its grid area; in contexts that supply default alignment via a container-level property such as place-items, using place-self on a child overrides the container defaults for that specific item. It also respects logical axes, so its effect follows writing-mode and direction (for example, vertical writing modes swap which axis is considered “inline” or “block”), and it interacts with available free space and size constraints — if there’s no extra space along an axis, alignment settings may visually have no effect.

Definition

Initial value
See individual properties
Applies to
Block-level boxes, absolutely-positioned boxes, and grid items
Inherited
No
Computed value
See individual properties
Animatable
Yes
JavaScript syntax
object.style.placeSelf

Interactive Demo

One
Two
Three

Syntax

place-self: <align-self> <justify-self>?

Values

Example

<div class="grid">
<div class="item item-a">place-self: auto (default)</div>
<div class="item item-b">place-self: start</div>
<div class="item item-c">place-self: center</div>
<div class="item item-d">place-self: end</div>
<div class="item item-e">place-self: stretch</div>
</div>
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 100px;
    gap: 12px;
    width: 720px;
    margin: 40px auto;
    background: #f3f4f6;
    padding: 12px;
    border-radius: 8px;
}

.item {
    background: linear-gradient(135deg, #60a5fa, #7c3aed);
    color: #ffffff;
    padding: 12px;
    border-radius: 6px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
}

.item-a {
    place-self: auto; /* default: follows container alignment */
}

.item-b {
    place-self: start; /* aligns both axes to the start */
}

.item-c {
    place-self: center; /* centers both axes */
}

.item-d {
    place-self: end; /* aligns both axes to the end */
}

.item-e {
    place-self: stretch; /* stretches to fill the grid area */
}

Browser Support

The following information will show you the current browser support for the CSS place-self property. Hover over a browser icon to see the version that first introduced support for this CSS property.

This property is supported by all modern browsers.
Desktop
Chrome
Edge
Firefox
Opera
Safari
Tablets & Mobile
Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-

Last updated by CSSPortal on: 1st January 2026

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!