CSS z-index examples

CSS z-index

HTML
<h1>CSSTUTORIAL.IO</h1>
CSS
body{
  font-family: 'Montserrat', sans-serif;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  background: #c5f7d9; 
}

h1{
  margin: 0;
  font-size: 50px;
  color: #3a3a3a;
  cursor: pointer;
}

h1:after{
  content:'';
  position: absolute;
  left: 0;  
  bottom: 0;
  height: 30px;
  width: 270px;
  background: #85dca8;
  z-index: -1;
}

h1:hover:after{
  width: 100%;
  transition: all 1s ease-in-out;
}
548 Views
87400cookie-checkCSS z-index examples

Leave a Reply

Your email address will not be published. Required fields are marked *