CSS Property Value How to - background-image: linear-gradient








Question

We would like to know how to background-image: linear-gradient.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.block {<!--from   www . ja v  a 2s. com-->
  width: 259px;
  padding: 12px;
  background-image: -o-linear-gradient(bottom, rgb(219, 203, 0) 0%, rgb(255, 236, 0) 100%);
  background-image: -moz-linear-gradient(bottom, rgb(219, 203, 0) 0%, rgb(255, 236, 0) 100%);
  background-image: -webkit-linear-gradient(bottom, rgb(219, 203, 0) 0%, rgb(255, 236, 0) 100%);
  background-image: -ms-linear-gradient(bottom, rgb(219, 203, 0) 0%, rgb(255, 236, 0) 100%);
  background-image: linear-gradient(bottom, rgb(219, 203, 0) 0%, rgb(255, 236, 0) 100%);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffec00', endColorstr='#dbcb00');
  border: 2px dashed #fff;
  background-origin: border-box;
}
</style>
</head>
<body>
  <div class="block">
    <br> <br> <br>
  </div>
</body>
</html>

The code above is rendered as follows: