Sets the height of the left margin of the object.


{ margin-left:sWidth}

Possible values


Variant that specifies or receives one of the following values:


Default. Left margin is set equal to the right margin.


Floating-point number, followed by an absolute units designator (cm, mm, in, pt, or pc) or a relative units designator (em, ex, or px).

For more information about the supported length units, see Length units reference.


Integer, followed by a percent sign (%). The value is a percentage of the height of the parent object.

The property has a default value of auto and is not inherited.


For inline elements, the value of this property is used to compute the border area of a surrounding inline element, if it is present. This value does not contribute to the height of a line.

Negative margins are supported, except for top and bottom margins on inline objects.


The following example uses the margin-left property to change the margin of the object. This example uses the HR element as a selector and margin1 as a class in an embedded style sheet to set the top margin of the horizontal rule:

    hr { margin-left: 2cm; }
    .margin1 { margin-left: 4cm; }
<hr onclick="this.className='margin1'" ondblclick="this.className=''">

This example uses inline scripting to set and reset the margin when the onclick and ondblclick events occur, respectively:

<hr onclick="'2cm'" 
ondblclick=" =''">

Standards information

This property is defined in Cascading Style Sheets (CSS), Level 1 (CSS1) Ee371308.xtlink_newWindow(en-us,Expression.40).png.

Applies to

a, abbr, acronym, b, bdo, big, blockquote, body, button, caption, center, cite, code, custom, dd, defaults, del, dfn, div, dl, dt, em, embed, fieldset, font, form, hn, hr, i, iframe, img, input type=button, input type=checkbox, input type=file, input type=image, input type=password, input type=radio, input type=reset, input type=submit, input type=text, ins, li, object, ol, p, q, s, span, sub, table, td, th, tt, u, ul, var, xmp

See also



Send feedback about this topic to Microsoft. © 2011 Microsoft Corporation. All rights reserved.