Revision 25460 of padding-left

  • Revision slug: CSS/padding-left
  • Revision title: padding-left
  • Revision id: 25460
  • Created:
  • Creator: Yuichiro
  • Is current revision? No
  • Comment 16 words added, 2 words removed

Revision Content

{{ CSSRef() }}

Summary

The padding-left property of an element sets the padding space required on the left side of an element. Padding area is the space between the content of the element and it's border. A negative value is not allowed.

  • {{ Xref_cssinitial() }}: 0
  • Applies to: all elements except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column
  • {{ Xref_cssinherited() }}: no
  • Percentages: refer to {{ Cssxref("width") }} of closest block-level ancestor
  • Media: {{ Xref_cssvisual() }}
  • {{ Xref_csscomputed() }}: the percentage as specified or the absolute length

Syntax

padding-left: {{ Xref_csslength() }} | {{ Xref_csspercentage() }} | {{ Cssxref("inherit") }};

Values

<length>
Specifies a positive fixed width. See {{ Xref_csslength() }} for details.
<percentage>
A percentage with respect to the width of the containing block.

Examples

.content { padding-left: 5%; }
.sidebox { padding-left: 10px; } 

Specifications

Browser compatibility

Browser Lowest version
Internet Explorer 4.0
Firefox (Gecko) 1.0 (1.0)
Opera 3.5
Safari (WebKit) 1.0 (85)

See also

{{ CSS_Reference:Padding() }}

{{ languages( { "de": "de/CSS/padding-left", "ja": "ja/CSS/padding-left" } ) }}

Revision Source

<p>{{ CSSRef() }}</p>
<h3 name="Summary">Summary</h3>
<p>The <code>padding-left</code> property of an element sets the padding space required on the left side of an element. Padding area is the space between the content of the element and it's border. A negative value is not allowed.</p>
<ul> <li>{{ Xref_cssinitial() }}: 0</li> <li>Applies to: all elements except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column</li> <li>{{ Xref_cssinherited() }}: no</li> <li>Percentages: refer to {{ Cssxref("width") }} of closest block-level ancestor</li> <li>Media: {{ Xref_cssvisual() }}</li> <li>{{ Xref_csscomputed() }}: the percentage as specified or the absolute length</li>
</ul>
<h3 name="Syntax">Syntax</h3>
<pre class="eval">padding-left: {{ Xref_csslength() }} | {{ Xref_csspercentage() }} | {{ Cssxref("inherit") }};
</pre>
<h3 name="Values">Values</h3>
<dl> <dt>&lt;length&gt;</dt> <dd>Specifies a positive fixed width. See {{ Xref_csslength() }} for details.</dd> <dt>&lt;percentage&gt;</dt> <dd>A percentage with respect to the width of the containing block.</dd>
</dl>
<h3 name="Examples">Examples</h3>
<pre>.content { padding-left: 5%; }
.sidebox { padding-left: 10px; } 
</pre>
<h3 name="Specifications">Specifications</h3>
<ul> <li><a class="external" href="http://www.w3.org/TR/CSS1#padding-left">CSS 1</a></li> <li><a class="external" href="http://www.w3.org/TR/CSS21/box.html#padding-properties">CSS 2.1 box</a></li> <li><a class="external" href="http://www.w3.org/TR/css3-box/#the-padding">CSS 3 box</a></li>
</ul>
<h3 name="Browser_compatibility">Browser compatibility</h3>
<table class="standard-table"> <tbody> <tr> <th>Browser</th> <th>Lowest version</th> </tr> <tr> <td>Internet Explorer</td> <td>4.0</td> </tr> <tr> <td>Firefox (Gecko)</td> <td>1.0 (1.0)</td> </tr> <tr> <td>Opera</td> <td>3.5</td> </tr> <tr> <td>Safari (WebKit)</td> <td>1.0 (85)</td> </tr> </tbody>
</table>
<h3 name="See_also">See also</h3>
<p>{{ CSS_Reference:Padding() }}</p>
<p>{{ languages( { "de": "de/CSS/padding-left", "ja": "ja/CSS/padding-left" } ) }}</p>
Revert to this revision