HTML CSS Reference/CSS Attributes and Javascript Style Properties/margin left

Материал из Web эксперт
Перейти к: навигация, поиск

"margin-left" Example

   <source lang="html4strict">
   

<html> <head> </head> <body>

The following image has a left margin of 3mm.

<img src="http://www.wbex.ru/style/logo.png"

    height="50" 
    width="50" 
    style="margin-left="3mm"">

</body> </html>


     </source>
   
  


"margin-left" is applied to

   <source lang="html4strict">

+----------------+--------------------------------------------------------------+ | Applied_To |<a> <acronym> | | | |

| |
|

| |<body> <button> |

| |
|

| | | | |currentStyle <custom> | | |

defaults | | | |

| |<dir>
| | |
| | | <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-left" Possible Values

        <source lang="html4strict"> Possible Values auto The default; bottom and top margins are equal. integer A floating-point number followed by a unit designator. percentage Percentage of the parent element"s height.


        </source>



        "margin-left" Syntax and Note

        <source lang="html4strict"> Note: Define the element left margin. Syntax:

        element { margin-left: value } elementID.style.marginLeft = "value" document.all.elementID.style.marginLeft = "value" // IE only


        </source>