Menu Home

margin-left

osbo.com | CSS | Properties | margin-left

The margin-left CSS property sets the left margin of a box.

Syntax

CSS

margin-left: value;

JS

object.style.marginLeft = "value";

Values

<'margin-left'> = <length-percentage> | auto
<length-percentage> = [ <length> | <percentage> ]
<length>

Specifies the length using a number followed by a unit of measurement.

<percentage>

Specifies the percentage using a number followed by a percent sign (%).

auto

Automatically specified by the user agent.

Initial

0

Examples

auto

length

percentage

JS

Internal

margin

margin-bottom

margin-right

margin-top

External

World Wide Web Consortium (W3C)