left

  • Revision slug: CSS/left
  • Revision title: left
  • Revision id: 26454
  • Created:
  • Creator: thatryan
  • Is current revision? No
  • Comment Added sample code, and link to positioning example.; 52 words added, 16 words removed

Revision Content

{{ CSSRef() }}

Summary

The left property specifies part of the position of positioned elements.

For absolutely positioned elements (those with {{ Cssxref("position") }}: absolute or position: fixed), it specifies the distance between the left margin edge of the element and the left edge of its containing block.

  • {{ Xref_cssinitial() }}: {{ Cssxref("auto") }}
  • Applies to: positioned elements
  • {{ Xref_cssinherited() }}: no
  • Percentages: refer to width of containing block
  • Media: {{ Xref_cssvisual() }}
  • {{ Xref_csscomputed() }}: absolute length, percentage, or auto

Syntax

left: <length> | <percentage> | auto | inherit ;

Values

{{ Xref_csslength() }} 
A length, can be negative, zero, or positive.
{{ Xref_csspercentage() }} 
A percentage of the containing block's width.

Examples

{{ CSSLiveSample("css-positioning.html") }}

 

#example_3 {
  width: 600px;
  height: 400px;
  background-color: #FFC7E4;
  position: relative;
  top: 20px;
  left: 20px;
}

#example_4 {
  width:200px;
  height:200px;
  background-color: #FFD7C2;
  position:absolute;
  bottom:10px;
  right: 20px;
}

Notes

Specifications

Browser compatibility

{{ Fixbrowser() }}

Browser Lowest Version
Internet Explorer 5.5
Firefox (Gecko) 1.0 (1.0)
Opera 5
Safari (Webkit) 1.0 (85)

See also

{{ Cssxref("position") }}, {{ Cssxref("top") }}, {{ Cssxref("right") }}, {{ Cssxref("bottom") }}

 

{{ languages( { "de": "de/CSS/left", "es": "es/CSS/left", "pl": "pl/CSS/left" } ) }}

Revision Source

<p>{{ CSSRef() }}</p>
<h3 name="Summary">Summary</h3>
<p>The <code>left</code> property specifies part of the position of positioned elements.</p>
<p>For absolutely positioned elements (those with {{ Cssxref("position") }}<code>: absolute</code> or <code>position: fixed</code>), it specifies the distance between the left margin edge of the element and the left edge of its containing block.</p>
<ul> <li>{{ Xref_cssinitial() }}: {{ Cssxref("auto") }}</li> <li>Applies to: <a href="/en/CSS/position" title="en/CSS/position">positioned elements</a></li> <li>{{ Xref_cssinherited() }}: no</li> <li>Percentages: refer to width of containing block</li> <li>Media: {{ Xref_cssvisual() }}</li> <li>{{ Xref_csscomputed() }}: absolute length, percentage, or auto</li>
</ul>
<h3 name="Syntax">Syntax</h3>
<pre class="eval">left: &lt;length&gt; | &lt;percentage&gt; | auto | inherit ;
</pre>
<h3 name="Values">Values</h3>
<dl> <dt>{{ Xref_csslength() }} </dt> <dd>A length, can be negative, zero, or positive.</dd> <dt>{{ Xref_csspercentage() }} </dt> <dd>A percentage of the containing block's width.</dd>
</dl>
<h3 name="Examples">Examples</h3>
<p>{{ CSSLiveSample("css-positioning.html") }}</p>
<p> </p>
<pre class="eval">#example_3 {
  width: 600px;
  height: 400px;
  background-color: #FFC7E4;
  position: relative;
  top: 20px;
  left: 20px;
}

#example_4 {
  width:200px;
  height:200px;
  background-color: #FFD7C2;
  position:absolute;
  bottom:10px;
  right: 20px;<br>}</pre><h3 name="Notes">Notes</h3>
<h3 name="Specifications">Specifications</h3>
<ul> <li><a class="external" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-left">CSS 2.1</a></li> <li><a class="external" href="http://www.w3.org/Style/CSS/current-work#positioning">CSS 3</a></li>
</ul>
<h3 name="Browser_compatibility">Browser compatibility</h3>
<p>{{ Fixbrowser() }}</p>
<table class="standard-table"> <tbody> <tr> <th>Browser</th> <th>Lowest Version</th> </tr> <tr> <td>Internet Explorer</td> <td>5.5</td> </tr> <tr> <td>Firefox (Gecko)</td> <td>1.0 (1.0)</td> </tr> <tr> <td>Opera</td> <td>5</td> </tr> <tr> <td>Safari (Webkit)</td> <td>1.0 (85)</td> </tr> </tbody>
</table>
<h3 name="See_also">See also</h3>
<p>{{ Cssxref("position") }}, {{ Cssxref("top") }}, {{ Cssxref("right") }}, {{ Cssxref("bottom") }}</p>
<p> </p> <p>{{ languages( { "de": "de/CSS/left", "es": "es/CSS/left", "pl": "pl/CSS/left" } ) }}</p>
Revert to this revision