HTML | DOM Style zIndex Property Last Updated : 05 Jun, 2022 Comments Improve Suggest changes Like Article Like Report The Style zIndex property is used for set or return the stack order of a positioned element. The element which has a lower stack order will be behind of another element with higher stack order. For example, the element with stack order(1) will be in front of the element with stack order(0). The Style zIndex property is generally used when the user wants to create overlapping elements. Syntax : To get the property:object.style.zIndex;To set the property:object.style.zIndex = "auto|number|initial|inherit" Property Values: auto: It is used to let the browser determine the stack order of the element.number: It uses an integer that defines the stack order of the element.initial: It is used to set the default value.inherit: It is used to inherit property from its parent. Return Values: It returns a string value, which represents the stack order of an element. Below program illustrates the Style zIndex property : Example: Changing the stack order of an <img> element. html <!DOCTYPE html> <html> <head> <title>Style zIndex Property</title> <style> #MyImage { position: absolute; left: 200px; top: 80px; z-index: -1 } h1 { color: green; } h2 { font-family: Impact; } body { text-align: center; } </style> </head> <body> <center> <h1>GeeksforGeeks</h1> <h2>Style zIndex Property</h2> <img id="MyImage" src= "https://media.geeksforgeeks.org/wp-content/uploads/gfg_200X200-1.png" width="200" height="200"> <button type="button" ondblclick="stack()"> Bring Logo In The Front </button> <p>This is the logo of Geeksforgeeks.It has z-index as 0.</p> <br> <p>To bring the logo in the front, double-click the "Bring Logo In The Front" button.</p> <script> function stack() { document.getElementById("MyImage").style.zIndex = "1"; } </script> </center> </body> </html> Output: Before clicking the button: After double clicking on the button: Supported Browsers: The browser supported by HTML | DOM Style zIndex Property are listed below: Google Chrome 1 and aboveEdge 12 and aboveInternet Explorer 4 and aboveFirefox 1 and aboveOpera 4 and aboveApple Safari 1 and above Comment More infoAdvertise with us S Shubrodeep Banerjee Follow Improve Article Tags : Web Technologies HTML HTML-DOM Similar Reads HTML | DOM Textarea Object The Textarea Object in HTML DOM is used to represent the HTML <textarea> Element. The textarea element can be accessed by using getElementById() method.Syntax: document.getElementById("ID"); Where ID is assigned to the <textarea> element.Property Values: autofocus: It is used to set or r 3 min read HTML | DOM Style animationPlayState Property The HTML DOM Style animationPlayState Property is used to specify whether an animation is running or paused. Syntax : animation-play-state: running|paused|initial|inherit; Return Values: It returns a string that represents the animation-play-state property of an element Property Values: running: Thi 3 min read HTML | DOM Map Object The Map Object in HTML DOM is used to create and access the <map> element. The Map Object create the portion of image clickable and accessible.Syntax: It is used to return Map object.var x = document.getElementById("myMap");It is used to create Map Object.var x = document.createElement("MAP"); 2 min read HTML | DOM Style backgroundImage Property The DOM Style backgroundImage Property is used to set or return the background image of an element. Syntax: To get the backgroundImage propertyobject.style.backgroundImageTo set the backgroundImage propertyobject.style.backgroundImage = "image | none | initial | inherit" Return Values: It returns a 3 min read HTML | DOM TableRow Object The TableRow Object in HTML DOM is used to represent the HTML <tr> element. The <tr> element can be accessed by using getElementById() method. Syntax: document.getElementById("id"); The tr element can be created by using the document.createElement() method. Syntax: document.createElement 3 min read HTML DOM Style order Property The HTML DOM Style order property specifies the order of a flexible element relative to the rest of the flexible elements inside the same container element. SyntaxSet the order property.object.style.order = "number | initial | inherit"Return the order property.object.style.orderReturn ValuesIt retu 1 min read HTML | DOM Embed Object The Embed Object in HTML DOM is used to represent the <embed> element. The <embed> element can be accessed by using getElementById() method. Note: This object is new in HTML 5. Property Values: height: It sets or returns the value of the height attribute. src: It sets or returns the valu 2 min read HTML DOM Anchor Object The Anchor Object in HTML DOM is used to represent the <a> element. The anchor element can be accessed by using getElementById() method. Syntax: document.getElementById("ID"); Where ID is assigned to the anchor tag. Property Values: Property Description charset Set or return the character set. 2 min read HTML DOM ColumnGroup Object The ColumnGroup Object in HTML DOM is used to represent the HTML <colgroup> element. This tag is used to set or return the properties of <colgroup> element. It can be accessed by using getElementById() method. Syntax: document.getElementById( "ColGroup_ID" );This ColGroup_ID is assigned 2 min read HTML | DOM Window frameElement Properties HTML DOM Window frameElement property returns the iframe element in which the window is embedded or stored. If it is not stored, in that case, it simply returns a null value. Syntax: window.frameElement Return Value: It returns an IFrame object or null. Example: html <!DOCTYPE html> <html 1 min read Like