DIV with color division

Asked

Viewed 668 times

0

I wonder how I can make my div with this color division:

inserir a descrição da imagem aqui

Thanks in advance.

1 answer

1


You will need to use CSS linear-gradient.

The linear-gradient

linear-gradient is a CSS3 feature to create gradients between 2 or more colors in line.

So you will need to use the following code to generate this background in your div

.gradientbg{
    background: #f6f5f4;
    background: -moz-linear-gradient(-45deg, #f6f5f4 0%, #f6f5f4 50%, #ffffff 51%, #ffffff 100%);
    background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,#f6f5f4), color-stop(50%,#f6f5f4), color-stop(51%,#ffffff), color-stop(100%,#ffffff));
    background: -webkit-linear-gradient(-45deg, #f6f5f4 0%,#f6f5f4 50%,#ffffff 51%,#ffffff 100%);
    background: -o-linear-gradient(-45deg, #f6f5f4 0%,#f6f5f4 50%,#ffffff 51%,#ffffff 100%);
    background: -ms-linear-gradient(-45deg, #f6f5f4 0%,#f6f5f4 50%,#ffffff 51%,#ffffff 100%);
    background: linear-gradient(135deg, #f6f5f4 0%,#f6f5f4 50%,#ffffff 51%,#ffffff 100%);
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f6f5f4', endColorstr='#ffffff',GradientType=1 );
  border: 1px solid #000;
  height: 100px;
  width: 100%;
}
<div class="gradientbg"></div>

  • Thank you very much!!

  • Erlon, I need to increase the ash gradient a little to the right, as I can do?

  • Use the Colorzilla, this app will help you a lot to create the visual effects css you need

Browser other questions tagged

You are not signed in. Login or sign up in order to post.