Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Z-order
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==z-index{{Anchor|ZX}}== The actual number assigned to a particular place in the Z-order is sometimes known as the z-index. In particular the [[CSS]] property that sets the stack order of specific elements is known as the z-index. An element with greater stack order is always in front of another element with lower stack order.<ref name="W3C-zindex"/> <syntaxhighlight lang="css"> p { position: relative; z-index: -1; } </syntaxhighlight> Negative stack orders can also be used in the same manner. A negative value will appear behind a positive one. <code>z-index</code> only works on elements that have a position value (e.g. <code>position: relative;</code>) and for many coders, this one of the first things to investigate when debugging why the z-index isn't working.<ref>{{Cite web|url=https://www.thewebdeveloperguide.com/css-z-index-not-working-send-help/|title=CSS Z-Index Not Working! Send Help!|date=2019-03-28|website=The Web Developer Guide|language=en-US|access-date=2019-04-10}}</ref> Like all other CSS properties, it can be set with [[JavaScript]] as well with the following syntax: <syntaxhighlight lang="javascript"> object.style.zIndex= '1'; </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)