margin-left
Sets the height of the left margin of the object.
sHeight
Variant that specifies or receives one of the following values:
auto | Default. Top margin is set equal to the bottom margin. |
height | 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. |
percentage | 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.
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:
<style>
HR { margin-left: 2cm; }
.margin1 { margin-left: 4cm; }
</style>
</head>
<body>
<HR onclick="this.className='margin1'" ondblclick="this.className=''">
</style>
This example uses inline scripting to set and reset the margin when the onclick and ondblclick events occur, respectively:
<HR onclick="this.style.marginTop='2cm'" ondblclick="this.style.marginTop=''">
This property is defined in Cascading Style Sheets (CSS), Level 1 (CSS1).
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