Glubase - share your knowledge


All / Computers / Programming / CSS





  • View Command

CSS Reference

CSS left definition

Syntax

right: auto | <percentage> | <length>

Description

For absolutely positioned elements this property defines how far the left edge of an element is to the right of the left edge of the containing block (beginning at the padding's edge). The containing block of an absolutely positioned element is the first ancestor whose position property is set to absolute, fixed or relative.

For relatively positioned elements this property defines how far the left edge of the element is to the right of the position that the element would be at normally. 

If both right and left have values one of the values will be overriden. If the direction property is set to rtl, left will be ignored and if the direction property is set to ltr, right will be ignored.

Values

Values Description
auto Default. The browser calculates the left position.
percentage Defines a left position percentage value from the edge of an element.
length Defines a left position length from the edge of an element.

Version Information

Available since CSS 2.0

See Also

direction

Version information

Available since CSS 2.0

Example

[Try this example yourself]
<style type="text/css">
.absoluteposition
{
position:absolute;
top:25px;
left:25px;
}
</style>
<div style="position:absolute;width:100%">
<p class="absoluteposition">Some absolutely positioned text.</p>
<p>Some ordinary text</p>
<p>Some ordinary text</p>
<p>Some ordinary text</p>
<p>Some ordinary text</p>
<p>Some ordinary text</p>
</div>

Output

Some absolutely positioned text.

Some ordinary text

Some ordinary text

Some ordinary text

Some ordinary text

Some ordinary text

  • Comments

No comments added.