Effect How to - Hover to animate square to circle fade








Question

We would like to know how to hover to animate square to circle fade.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
div {<!--from   ww w. j  av a2  s  .c  o m-->
  width: 100px;
  height: 100px;
  background: red;
  transition: all 1s;
  -webkit-transition: all 1s;
  -moz-transition: all 1s;
}

div:hover {
  border-radius: 50%;
}
</style>
</head>
<body>
  <div></div>
</body>
</html>

The code above is rendered as follows: