Progressive css hover

In this example below you will see how to do a Progressive css hover with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by tibomahe, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright tibomahe ©
  • HTML
  • CSS
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>Progressive css hover</title>
  
  
  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <ul class="nav">
  <li>
    <a href="#">
	  	Home
	  	<div class="hover">Home</div>
	</a>
  </li>
  <li>
    <a href="#">
	  	How it works ?
	  	<div class="hover">How it works ?</div>
	</a>
  </li>
  <li>
    <a href="#">
	  What is what ?
	  	<div class="hover">	What is what ?</div>
	</a>
  </li>
</ul>
  
  

</body>

</html>

/*Downloaded from https://www.codeseek.co/tibomahe/progressive-css-hover-gaBobb */
@import url(https://fonts.googleapis.com/css?family=Roboto:400,100,300,700,900);
ul {
  list-style: none;
}
ul li {
  height: 40px;
  width: 260px;
  overflow: hidden;
}
ul li a {
  text-decoration: none;
  font-family: "Roboto",Helvetica,sans-serif;
  text-transform: uppercase;
  font-size: 32px;
  font-weight: 700;
  line-height: 40px;
  color: #444;
}
ul li a .hover {
  position: relative;
  overflow: hidden;
  line-height: 40px;
  font-size: 32px;
  font-weight: 700;
  width: 0%;
  color: #d74d4d;
  backgriund: #fff;
  top: -40px;
  left: 0;
  -webkit-transition: width 0.5s ease-out;
  transition: width 0.5s ease-out;
}
ul li.active a .hover, ul li:hover a .hover {
  width: 100%;
}

Comments