inset-inline-end

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2021.

* Some parts of this feature may have varying levels of support.

inset-inline-endCSS のプロパティで、要素における行末からの論理的な内部位置を定義し、要素の書字方向やテキストの向きに従って物理的なオフセットに対応付けられます。 top, right, bottom, left のいずれかのプロパティに、 writing-mode, direction, text-orientation で定義された値に従って対応します。

試してみましょう

writing-mode: horizontal-tb;
writing-mode: vertical-rl;
writing-mode: horizontal-tb;
direction: rtl;
writing-mode: vertical-lr;
<section id="default-example">
  <div class="example-container" id="example-element">
    <div id="abspos">
      I am absolutely positioned with inset-inline-end: 50px
    </div>
    <p>
      As much mud in the streets as if the waters had but newly retired from the
      face of the earth, and it would not be wonderful to meet a Megalosaurus,
      forty feet long or so, waddling like an elephantine lizard up Holborn
      Hill.
    </p>
  </div>
</section>
#example-element {
  border: 0.75em solid;
  padding: 0.75em;
  position: relative;
  width: 100%;
  min-height: 200px;
  unicode-bidi: bidi-override;
}

#abspos {
  background-color: yellow;
  color: black;
  border: 3px solid red;
  position: absolute;
  inset-inline-end: 50px;
  inline-size: 140px;
  min-block-size: 80px;
}

構文

css
/* <length> 値 */
inset-inline-end: 3px;
inset-inline-end: 2.4em;

/* 包含ブロックの幅または高さに対する <percentage> 値 */
inset-inline-end: 10%;

/* キーワード値 */
inset-inline-end: auto;

/* グローバル値 */
inset-inline-end: inherit;
inset-inline-end: initial;
inset-inline-end: revert;
inset-inline-end: revert-layer;
inset-inline-end: unset;

inset-inline-startinset-inline-end の一括指定は inset-inline です。

inset-inline-end プロパティは left プロパティと同じ値を取ります。

公式定義

初期値auto
適用対象位置指定要素
継承なし
パーセント値包含ブロックの論理的な幅
計算値方向が論理的である以外はボックスのオフセット、 top, right, bottom, left と同じ
アニメーションの種類length または パーセント値, calc();

形式文法

inset-inline-end = 
auto |
<length-percentage>

<length-percentage> =
<length> |
<percentage>

インライン方向の末尾のオフセットの設定

HTML

html
<div>
  <p class="exampleText">テキストの例</p>
</div>

CSS

css
div {
  background-color: yellow;
  width: 120px;
  height: 120px;
}

.exampleText {
  writing-mode: vertical-rl;
  position: relative;
  inset-inline-end: 20px;
  background-color: #c8c800;
}

結果

仕様書

Specification
CSS Logical Properties and Values Level 1
# propdef-inset-inline-end
CSS Positioned Layout Module Level 3
# propdef-inset-inline-end

ブラウザーの互換性

関連情報