HTML CSS Reference/CSS Attributes and Javascript Style Properties/z index

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

"z-index" Example

   <source lang="html4strict">

<html> <body>

This div is absolute positioned with an z-index of 1.

This is a div element with a z-index of 12.

<button onclick="myDiv.style.zIndex = 20;"> Bring red to front </button> </body> </html>


     </source>
   
  


"z-index" is applied to

   <source lang="html4strict">

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

| |
|

| |<button> |

| |
|

| | <col> | | |<colgroup> currentStyle | | |<custom>

| | |defaults |

| |<dir>
| | |
| | | <fieldset> | | |<form> | | |<iframe> <inputtype="button"> | | |<input type="checkbox"> <input type="file"> | | |<input type="image"> <input type="password"> | | |<input type="radio"> <input type="reset"> | | |<inputtype="submit"> <input type="text"> | | |<isindex> | | |<label> <legend> | | |
  • <listing> | | |<marquee> <menu> | | |

      | | |

                                 runtimeStyle                  |
      |                |                                                     |
      |                |                                                 |
      |                |                                              |
      |                |style                                                    |
      |                |                                                  |
      |                |<tbody>                                                   |
      |                |                             
        | | | <xmp> | +----------------+--------------------------------------------------------------+ </source>

        "z-index" Possible Values

        <source lang="html4strict"> Possible Values auto The default; integer An integer value that determines the position of the element in the stacking order.

        Elements with a higher z-index value appear on top.


        </source>



        "z-index" Syntax and Note

        <source lang="html4strict"> Note: How to position elements. Elements with a higher z-index value appear on top.

        Syntax:

        element { z-index: value } elementID.style.zIndex = "value" document.all.elementID.style.zIndex = "value" // IE only


        </source>

      |

      | |<textarea> <tfoot> |

      | |
      <thead> | | |