Animation How to - Hover to zoom arrow








Question

We would like to know how to hover to zoom arrow.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.box {<!--from  w ww .j  ava  2 s . c o  m-->
  position: relative;
  margin: 20px;
  width: 20em;
  height: 20em;
  border: 1px solid rgb(77, 77, 77);
  box-shadow: 0px 0px 4px 0px rgb(189, 189, 189), 0px 0px 0px 0px black
    inset;
}

.box:hover {
  width: 10em;
  margin: 10px;
  zoom: 200%;
}

.box:before {
  content: '';
  position: relative;
  width: 30%;
  left: 0;
  right: 80%;
  height: 40px;
  top: 45%;
  background: rgba(0, 0, 0, 0.1);
  display: inline-block;
}

.box:after {
  content: '';
  position: absolute;
  left: 30%;
  top: 45%;
  margin-top: -20px;
  border-style: solid;
  border-width: 40px;
  border-color: transparent transparent transparent rgba(0, 0, 0, 0.1);
}
</style>
</head>
<body>
  <div class="box"></div>
</body>
</html>

The code above is rendered as follows: