Easy Tutorial
❮ Css3 Pr Border Top Right Radius Css3 Pr Transform Style ❯

CSS margin-left Property

Example

Set the left margin of a p element:

p 
{
    margin-left:2cm;
}

Property Definition and Usage

The margin-left property sets the left margin of an element.

Note: Negative values are allowed.

Default value: 0
Inherited: no
--- ---
Version: CSS1
--- ---
JavaScript syntax: object.style.marginLeft="10px"
--- ---

Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Property
margin-left 1.0 6.0 1.0 1.0 3.5

Property Values

Value Description
auto The browser sets the left margin.
length Defines a fixed left margin. The default value is 0.
% Defines a percentage left margin based on the total width of the parent element.
inherit Specifies that the left margin should be inherited from the parent element.

Related Articles

CSS Tutorial: CSS Margin

❮ Css3 Pr Border Top Right Radius Css3 Pr Transform Style ❯