Questions tagged [radial-gradients]

A linear interpolation between two or more colors based on the distance from the center of a circle or ellipse. In radial gradients, the colors emerge from a single point and smoothly spread outward in a circular or elliptical shape unlike in linear gradients where it is from one end to another. Use this tag for any question pertaining to creation or usage of radial gradients.

Radial gradients are a linear interpolation between two or more colors based on the distance from the center of a circle or ellipse.

In radial gradients, the colors emerge from a single point and smoothly spread outward in a circular or elliptical shape unlike in linear gradients where it is from one end to another.

Radial Gradients in CSS

In CSS, a radial gradient can be created using the below syntax: (Source - W3C)

radial-gradient() = radial-gradient(
  [ [ circle               || <length> ]                          [ at <position> ]? , |
    [ ellipse              || [ <length> | <percentage> ]{2} ]    [ at <position> ]? , |
    [ [ circle | ellipse ] || <extent-keyword> ]                  [ at <position> ]? , |
    at <position> ,
  ]?
  <color-stop> [ , <color-stop> ]+
)
<extent-keyword> = closest-corner | closest-side | farthest-corner | farthest-side

Here is a sample rainbow generated using radial gradients:

.rainbow {
  height: 25vw;
  width: 50vw;
  background: -webkit-radial-gradient(50% 110%, ellipse, white 35%, violet 35%, violet 40%, indigo 40%, indigo 45%, blue 45%, blue 50%, green 50%, green 55%, yellow 55%, yellow 60%, orange 60%, orange 65%, red 65%, red 70%, white 70%);
  background: -moz-radial-gradient(50% 110%, ellipse, white 35%, violet 35%, violet 40%, indigo 40%, indigo 45%, blue 45%, blue 50%, green 50%, green 55%, yellow 55%, yellow 60%, orange 60%, orange 65%, red 65%, red 70%, white 70%);
  background: radial-gradient(ellipse at 50% 110%, white 35%, violet 35%, violet 40%, indigo 40%, indigo 45%, blue 45%, blue 50%, green 50%, green 55%, yellow 55%, yellow 60%, orange 60%, orange 65%, red 65%, red 70%, white 70%);
}

enter image description here

Useful Links/References:

353 questions
0
votes
0 answers

to move a Gradient radius depending on ios device position/movemeant

I'm developing a hybrid app and wondering if this scenario is feasible. I don't know the word for this... Imagine a Fulcrum, the middle of the device is on top of it. The top part of the device moves up or down, the lower part of the device moves…
0
votes
1 answer

Why does this radial gradient with transparency work in Firefox and not Chrome?

I need to create a "punchout" effect with a mask. Both the mask and punchout need an alpha transparency applied. It works here perfectly on Firefox but not on Chrome: http://codepen.io/anon/pen/WbbXKP What am I doing wrong? CSS: body { margin: 0; …
Saldog
  • 71
  • 1
  • 1
  • 4
0
votes
2 answers

How to force modern Internet Explorer to show proper gradient background in real web sites

body background is defined in inline css as body { background: radial-gradient( #EAC39F, rgb(255, 208, 160),#CB690C); } In real web sites latest Internet Explorer shows horizontal lines in background. In IE developer tools I turned all other…
Andrus
  • 26,339
  • 60
  • 204
  • 378
0
votes
2 answers

alter .css gradient in jquery using hex values AND variable

I have set a background gradient in the body of a website I'm building. I also have created a menu the items of which change to distinct colors on hover. What I'd like to do is ask just sections of the background gradient to change to the same color…
0
votes
1 answer

Correctly highlight a square with transparent radial gradient

I am trying to highlight a square with radial gradient effect. I created the following css rule: .highlight-move { background-color: #75f547; background-image: -webkit-radial-gradient(center center, circle cover, #75f547, #fff 100%); …
Salvador Dali
  • 214,103
  • 147
  • 703
  • 753
0
votes
1 answer

animate opacity of radial gradient without css3

I have a radials gradient and I want animate the opacity to make transparent and then restore the real opacity... I searched the posibles solutions such as context.globalAlpha but all radials gradient remain invisible and I want one... other…
Kappys
  • 673
  • 2
  • 7
  • 20
0
votes
1 answer

Embellishing D3 SVG circle pack diagram

My D3 circle pack looks like this: (also accesible via jsfiddle) However, I would like the diagram to look like this: (don't pay attention on labels, or circle pack placement, they are not essential for my case; I meant just co show "3d" looks of…
VividD
  • 10,456
  • 6
  • 64
  • 111
0
votes
2 answers

Center background gradient

I am a newbie to web development and I have just started coding for my own personal website. I absolutely do not know any syntax for html nor css. From reading and watching tutorials online, I have managed to create the background gradient of my…
0
votes
1 answer

CSS linear gradient from center

I am wondering if it is possible to do something like this with css gradients alone: http://postimg.org/image/nxciwsv4f/ In this example the center orange would fade into grey in all directions. The black rectangle represents a div. I couldn't find…
Anon Omus
  • 383
  • 4
  • 12
  • 25
0
votes
1 answer

How to keep transparent radial background smooth in browsers other than Chrome?

I am using CSS background gradients to create a transparent radial gradient effect. If you look here in Chrome: http://dev.aaronpitts.ch/unitymedia/index.html you will see it working how I want (the Social Media, SEM, Web Design and Begin your…
user1280853
  • 1,079
  • 5
  • 14
  • 23
0
votes
1 answer

Draw radial gradient from red to blue

I need to draw a circle with a gradient that starts with red and ends with blue. It should look like this one How to create such circle is explained here. But I have no idea how to draw such gradient. The problem is that the start color and end…
0
votes
0 answers

Gradients not working in jQuery

Here is the code: $('#pocetak h1.rastavljac').css({ 'background':'#3578ff;', 'background':'-moz-linear-gradient(left, #3578ff 0%, #7AA6ff 15%, #7AA6ff 85%, #3578ff 100%)', 'background':'-webkit-gradient(linear, left top, right top,…
Damiao
  • 51
  • 5
0
votes
2 answers

Can I use CSS to set a radial gradient 'overlay' to a div?

Here's an example of the image I'm using to give a div on my website a radial gradient 'white glow' effect. Currently that image is set as the div background - it's about 338KB big and that's unacceptable in web terms. It's incredibly…
sergserg
  • 21,716
  • 41
  • 129
  • 182
0
votes
1 answer

Render CSS3 gradient on IE9 with radial orientation

Im using Colorzilla gradient generator(http://www.colorzilla.com/gradient-editor/) to create a radial gradient for my site and I wanted to have the ellipse at the bottom. From background: #667de8; /* Old browsers */ /* IE9 SVG, needs…
Vincent Panugaling
  • 896
  • 1
  • 12
  • 28
0
votes
1 answer

Set gradient radius at runtime and center it around a button

Like many other posts listed here i struggle with radial gradient. post 1, 2, 3... I want 2 things: set a gradient around a button that has a selector as background drawable to get an aura effect adjust this gradient radius to have the same…
Poutrathor
  • 1,990
  • 2
  • 20
  • 44