HTML CSS Reference/CSS Attributes and Javascript Style Properties/position

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

"position" Example

   <source lang="html4strict">
   

<head> <script language="JavaScript">

   function function1(){
       myDiv.style.position = "absolute"; 
   }

</script> </head> <body>




    Click Here to set the position to absolute

</body>


     </source>
   
  


"position" is applied to

   <source lang="html4strict">

+----------------+--------------------------------------------------------------+ | Applied_To |<a> <address> | | |<applet> | | | |

| |
<button> | | |
|

| | currentStyle | | |<custom>

| | |defaults |

| |<dir>
| | |
| | | <embed> | | |<fieldset> | | |<form> <hn> | | |
|

| |<iframe> <img> | | |<input type="button"> <input type="checkbox"> | | |<input type="file"> <inputtype="image"> | | |<input type="password"> <input type="radio"> | | |<input type="reset"> <input type="submit"> | | |<input type="text"> <isindex> | | | <label> |

| |<legend>
  • | | |<listing> <marquee> | | |<menu> <object> | | |

      | | |

                                                         |
      |                |runtimeStyle                                               |
      |                |                          <select>                      |
      |                |                                                 |
      |                |                                              |
      |                |style                                                    |
      |                |                                                  |
      |                |                          |
      

      | | |

      | |
        | | |<xmp> | +----------------+--------------------------------------------------------------+ </source>

        "position" Possible Values

        <source lang="html4strict"> Possible Values static The default; position is determined by the normal flow of HTML elements

        absolute Position is relative to the parent element relative Position is calculated according to the normal flow of the HTML elements


        </source>



        "position" Syntax and Note

        <source lang="html4strict"> Note: Defines the positioning type. Syntax:

        element { position: value } elementID.style.position = "value" document.all.elementID.style.position = "value" // IE only


        </source>

      <textarea> | | |