Problems setting up Gradient in CSS

0

I want to put a background on the web page with a gradient effect, but it's the result I'm having;

It'sveryugly.

IusedthissettinginCSS;

body{font-size:12px;font-family:Arial,Helvetica,sans-serif;margin:0px;font-weight:normal;background-color:#205E99;background-image:linear-gradient(tobottom,rgba(255,255,255,.1),rgba(255,255,255,.4),rgba(255,255,255,0),rgba(255,255,255,.4));}

TheeffectIwantittohaveissimilartothat;

How do I do it?

    
asked by anonymous 08.07.2015 / 21:04

3 answers

1

With the reference you posted, I believe you have to improve the gradient code, I recommend using the following pattern:

body {
    font-size: 12px;
    font-family: Arial, Helvetica, sans-serif;
    margin: 0px;
    font-weight: normal;
    background: -webkit-linear-gradient(90deg, #fff 10%, #205E99 90%); /* Chrome 10+, Saf5.1+ */
    background:    -moz-linear-gradient(90deg, #fff 10%, #205E99 90%); /* FF3.6+ */
    background:     -ms-linear-gradient(90deg, #fff 10%, #205E99 90%); /* IE10 */
    background:      -o-linear-gradient(90deg, #fff 10%, #205E99 90%); /* Opera 11.10+ */
    background:         linear-gradient(90deg, #fff 10%, #205E99 90%); /* W3C */
}

I usually get the site link and change the colors.

    
16.07.2015 / 20:52
0

Try to find a gradient similar to what you want:

<div class="gra"></div>

.gra{
  background-image: linear-gradient(to right, #fff, #0000FF);
  height: 100px;
  border: 1px solid #e7e7e7;
  margin: 50px;
}
    
08.07.2015 / 21:35
-1

Using the powerful Gradient Generator

.gradient{
  width:500px;
  height:500px;

  /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#a0a5ff+0,2737fe+100 */
  background: rgb(160,165,255); /* Old browsers */
  background: -moz-linear-gradient(-45deg,  rgba(160,165,255,1) 0%, rgba(39,55,254,1) 100%); /* FF3.6+ */
  background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,rgba(160,165,255,1)), color-stop(100%,rgba(39,55,254,1))); /* Chrome,Safari4+ */
  background: -webkit-linear-gradient(-45deg,  rgba(160,165,255,1) 0%,rgba(39,55,254,1) 100%); /* Chrome10+,Safari5.1+ */
  background: -o-linear-gradient(-45deg,  rgba(160,165,255,1) 0%,rgba(39,55,254,1) 100%); /* Opera 11.10+ */
  background: -ms-linear-gradient(-45deg,  rgba(160,165,255,1) 0%,rgba(39,55,254,1) 100%); /* IE10+ */
  background: linear-gradient(135deg,  rgba(160,165,255,1) 0%,rgba(39,55,254,1) 100%); /* W3C */
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a0a5ff', endColorstr='#2737fe',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
}
<div class="gradient"></div>  
    
08.07.2015 / 21:23