Search code examples
cssradial-gradients

How can I create this background as a CSS3 radial gradient


I want to create the radial background effect shown in the image below

weather panel

as a CSS3 radial gradient. The trouble is that I only really discovered radial gradients a few minutes ago and my understanding of how they work is poor. My best effort thus far is

#weather
{
 height:200px;
 width:300px;
 border-radius:8px;
 background-image:radial-gradient(at top left,#667EA3 36%,#556D95 67%);
} 
<div id='weather'>&nbsp;</div>

which is nowhere near what I show in the image. I suspect that I need to play with farthest-side rather than trying to setting at top left as I have done but I am not quite sure how I do that.


Solution

  • #weather {
      height: 200px;
      width: 300px;
      border-radius: 8px;
      background-image: radial-gradient(at bottom right, #556D95 67%, #667EA3 67%);
    }
    <div id='weather'>&nbsp;</div>