Welcome ðŸŽ‰

logo

ReactLMS

Search
Light Mode
Contact Us

2 min to read

Contact us

No results for your search.
Sorry, an unexpected error occurred

Concept


z-index is a CSS property used to change the display priority of an object on the screen.

🌱
Tag when in absolute form, we can use CSS properties like top, bottom, left, right to move the tag as desired within the dependent area.


How to use


Example

HTML

<div class='result'>
  <span class='box1'>1</span>
  <span class='box2'>2</span>
</div>







CSS

.result {
  position : relative;
  height: 200px;
  background: lightcoral !important;
}

.result .box1 {
  background: pink;
  position: absolute;
  width: 50px;
  height: 50px;
  left: 30px;
  top: 30px;
  z-index: 1;
}

.result .box2 {
  background: red;
  position: absolute;
  width: 50px;
  height: 50px;
  left: 40px;
  top: 40px;
  z-index: 2;
}







Result

1 2




Read more
On This Page