-
What is z-index in CSS? |
Beta Was this translation helpful? Give feedback.
Answered by
Bunny77K9
Jun 18, 2022
Replies: 1 comment
-
Z-index is a property in CSS that is used to define the order of elements on a web page. It works on the basis of order indices, where a higher-order element will appear before a lower-order element. It only applies to elements that are positioned, i.e., those elements having the position attribute compulsorily. Consider the following example: div { |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
DuajDiaz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Z-index is a property in CSS that is used to define the order of elements on a web page. It works on the basis of order indices, where a higher-order element will appear before a lower-order element.
It only applies to elements that are positioned, i.e., those elements having the position attribute compulsorily.
Consider the following example:
div {
position: fixed;
left: 15px;
top: 20px;
z-index: -1;
}