Page Widget How to - Create CSS3 Border-image Gradient








Question

We would like to know how to create CSS3 Border-image Gradient.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
div {<!-- w w w  .  j  a va  2s.  c o  m-->
  width: 200px;
  height: 225px;
  background: #DFDFDF;
  border-style: solid;
  border-width: 15px;
  -webkit-border-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 1)
    1%, rgba(41, 184, 229, 1) 50%, rgba(255, 255, 255, 1) 100%);
}
</style>
</head>
<body>
  <div></div>
</body>
</html>

The code above is rendered as follows: