inset-block-end

Avatar of Geoff Graham
Geoff Graham on (Updated on )

📣 Freelancers, Developers, and Part-Time Agency Owners: Kickstart Your Own Digital Agency with UACADEMY Launch by UGURUS 📣

inset-block-end is a logical CSS property that sets the length that an element is offset in the block direction from its ending edge. It’s sort of like declaring bottom except its end point is determined by the element’s direction, text-orientation and writing-mode, just like other logical properties.

The property is part of the CSS Logical Properties and Values Level 1 specification which is currently in Editor’s Draft status. That means the definition and information about it can change between now and official recommendation.

.element {
  inset-block-end: 50px;
  position: relative; /* Apples to positioned elements */
  writing-mode: vertical-rl; /* Determines the block start direction */
}

So, for example, if the writing mode is set to horizontal-lr the inset-block-end property will act just like bottom and set the element’s offset from the bottom edge. You even need to specify an explicit position on the same element for it to take effect, just like bottom and other physical offset properties.

But change the element’s writing-mode to something like vertical-lr and the “bottom” edge is rotated in the vertical direction, acting more like the right property.

Syntax

inset-block-end: <'bottom'>;
  • Initial value: auto
  • Applies to: positioned elements
  • Inherited: no
  • Percentages: as for the corresponding physical property
  • Computed value: same as corresponding bottom property
  • Animation type: by computed value type

Values

inset-block-end takes a length value and supports global keywords. Its default value is auto.

/* Length values */
inset-block-end: 50px;
inset-block-end: 4em;
inset-block-end: 3.5rem
inset-block-end: 25vh;

/* Percentage values */
inset-block-end: 50%;

/* Keyword values */
inset-block-end: auto; /* initial value */

/* Global values */
inset-block-end: initial
inset-block-end: inherit;
inset-block-end: unset;

Browser support

IEEdgeFirefoxChromeSafariOpera
NoNo63+NoNoNo
Android ChromeAndroid FirefoxAndroid BrowseriOS SafariOpera Mini
No79+NoNoNo
Source: caniuse

Demo

Further reading