概要
padding-left プロパティは、要素の左に必要なパディング領域を設定します。パディング領域とは、要素の内容と境界との間の(枠内)余白のことです。負の値は許可されていません。
| 初期値 | 0 |
|---|---|
| 適用対象 | all elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column. It also applies to ::first-letter. |
| 継承 | 不可 |
| 相対値の基準 | 包含ブロックの幅 |
| メディア | visual |
| 計算値 | 指定されたパーセンテージ値または絶対的な長さ |
| アニメーションの可否 | 可。 の値として補完しますlength |
| 正規順序 | 形式文法で定義される一意のあいまいでない順序 |
構文
padding-left: <length> | <percentage> | inherit;
値
- <length>
- 正の固定幅を指定します。詳細は
<length>を参照してください。 - <percentage>
- 包含ブロックの幅に対する割合です。
サンプル
.content { padding-left: 5%; }
.sidebox { padding-left: 10px; }
Specifications
| Specification | Status | Comment |
|---|---|---|
| CSS Basic Box Model padding-left の定義 |
草案 | No change |
| CSS Transitions padding-left の定義 |
草案 | Defines padding-left as animatable. |
| CSS Level 2 (Revision 1) padding-left の定義 |
勧告 | No change |
| CSS Level 1 padding-left の定義 |
勧告 | Initial definition |
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
|---|---|---|---|---|---|
| Basic support | 1.0 | 1.0 (1.0) | 4.0 | 3.5 | 1.0 (85) |
| Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | ? | ? | ? | ? | ? |