left

« CSS « CSS Reference

Summary

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

For absolutely positioned elements (those with 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.

Syntax

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

Values

<length>  
A length, can be negative, zero, or positive.
<percentage>  
A percentage of the containing block's width.

Examples

View the live example

#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;
}

Specifications

Browser compatibility

  • Desktop
  • Mobile

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 1.0 1.0 (1.7 or earlier) 5.5 5.0 1.0
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support 1.0 1.0 (1) 6.0 6.0 1.0

See also

position , top , right , bottom

 

Tags (2)

Edit tags

Attachments (0)

 

Attach file