padding-inline-end
padding-inline-end
は CSS のプロパティで、要素のインライン方向の論理的な末尾側のパディングを定義し、それが要素の書字方向やテキストの方向に応じて物理的なマージンに対応付けられます。
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
構文
/* <length> 値 */
padding-inline-end: 10px; /* 絶対的な長さ */
padding-inline-end: 1em; /* テキストの大きさに対する相対値 */
/* <percentage> 値 */
padding-inline-end: 5%; /* ブロックコンテナーの幅に対する割合のパディング */
/* グローバル値 */
padding-inline-end: inherit;
padding-inline-end: initial;
padding-inline-end: unset;
値
padding-inline-end
プロパティは padding-left
プロパティと同じ値を取ります。
解説
これは
padding-top
, padding-right
, padding-bottom
, padding-left
の何れかのプロパティに対応し、どれに対応するかは writing-mode
, direction
, text-orientation
で定義された値によって決まります。
関連プロパティとして、要素の他のマージンを定義する padding-block-start
, padding-block-end
, padding-inline-start
があります。
公式定義
形式文法
例
縦書きテキストにおけるインライン方向の末尾のパディングの設定
HTML
<div>
<p class="exampleText">Example text</p>
</div>
CSS
div {
background-color: yellow;
width: 120px;
height: 120px;
}
.exampleText {
writing-mode: vertical-lr;
padding-inline-end: 20px;
background-color: #C8C800;
}
結果
仕様書
仕様書 | 状態 | 備考 |
---|---|---|
CSS Logical Properties and Values Level 1 padding-inline-end の定義 |
編集者草案 | 初回定義 |
ブラウザーの互換性
BCD tables only load in the browser
関連情報
- 対応付け先の物理的なプロパティ:
padding-top
,padding-right
,padding-bottom
,padding-left
writing-mode
,direction
,text-orientation