HTML CSS Reference/CSS Attributes and Javascript Style Properties/margin
"margin" Example
<source lang="html4strict">
<html> <body> <img id="myImg"
src="http://www.wbex.ru/style/logo.png" height="50" width="50" border="1">
<button onclick="myImg.style.margin="25 25 25 25"">25 Px Margin</button> <button onclick="myImg.style.margin="0 0 0 0"">0 Margin</button> </body> </html>
</source>
"margin" is applied to
<source lang="html4strict">
+----------------+--------------------------------------------------------------+ | Applied_To |<a> <acronym> | | | |
| ||| |<body> <button> |
| || | |
| |<dir>| | |currentStyle <custom> | | |
defaults | | | || | |
- | | | <embed> | | |<fieldset> | | |<form> <hn> | | |
|| |<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"> | | |<isindex> |
| |<label>- | | |<listing> <marquee> | | |<menu> <nobr> | | |<object>
| | |
| | |runtimeStyle | | || | | | | || | |style | | || | |
<textarea> | | | | | | | | | <xmp> | +----------------+--------------------------------------------------------------+ </source>
"margin" Syntax and Note
<source lang="html4strict"> Note: Controls four different margin style properties: margin-top, margin-right, margin-bottom, margin-left. Syntax:
element { margin: values } elementID.style.margin = "values" document.all.elementID.style.margin = "values" // IE only
</source>