Page Widget How to - Create fade in and fade out border








Question

We would like to know how to create fade in and fade out border.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
a {<!--  w  w  w .j av  a2 s.  com-->
  width: 100px;
  height: 100px;
  border-width: 50px;
  border-color: rgba(0, 0, 0, 0);
  border-radius: 100%;
  -moz-border-radius: 100%;
  -webkit-border-radius: 100%;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-transition: 0.5s ease;
  -moz-transition: 0.5s ease;
  -ms-transition: 0.5s ease;
  -o-transition: 0.5s ease;
  transition: 0.5s ease;
}

a:hover {
  border-width: 0;
  border-color: rgba(0, 0, 0, 0.5);
}

.one {
  border-style: solid;
}

</style>
</head>
<body>
  <a href="#" class="one">java2s.com</a>
</body>
</html>

The code above is rendered as follows: