gradient

by Mr_Vasu

HTML

<div class="mainBox">
  <div class="subBox"></div>
</div>

CSS

.mainBox {
  width: 100%;
  height: 300px;
  position: relative;
  background-color: black;
}
.subBox {
  width: 200px;
  height: 100px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  background: -moz-linear-gradient(0deg, rgba(86,70,120,1) 0%, rgba(255,255,255,1) 50%, rgba(101,118,87,1) 100%); /* ff3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(86,70,120,1)), color-stop(50%, rgba(255,255,255,1)), color-stop(100%, rgba(101,118,87,1))); /* safari4+,chrome */
background: -webkit-linear-gradient(0deg, rgba(86,70,120,1) 0%, rgba(255,255,255,1) 50%, rgba(101,118,87,1) 100%); /* safari5.1+,chrome10+ */
background: -o-linear-gradient(0deg, rgba(86,70,120,1) 0%, rgba(255,255,255,1) 50%, rgba(101,118,87,1) 100%); /* opera 11.10+ */
background: -ms-linear-gradient(0deg, rgba(86,70,120,1) 0%, rgba(255,255,255,1) 50%, rgba(101,118,87,1) 100%); /* ie10+ */
background: linear-gradient(90deg, rgba(86,70,120,1) 0%, rgba(255,255,255,1) 50%, rgba(101,118,87,1) 100%); /* w3c */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#564678', endColorstr='#657657',GradientType=1 ); /* ie6-9 */
}