Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS3 radial gradient appears as line

I've been trying to create a radial background, except for some reason all I can get is a line. I have no idea what I'm doing wrong, any ideas?

Jsfiddle: http://jsfiddle.net/3QSFj/1/

CSS:

background: -webkit-gradient(radial, circle, 0, circle, 70, color-stop(0%, #718aa7), color-stop(70%, #203044));
background: -webkit-radial-gradient(circle, #718aa7 0%, #203044 70%);
background: -moz-radial-gradient(circle, #718aa7 0%, #203044 70%);
background: -o-radial-gradient(circle, #718aa7 0%, #203044 70%);
background: radial-gradient(circle, #718aa7 0%, #203044 70%);
like image 296
Andrew Avatar asked Oct 26 '13 05:10

Andrew


People also ask

What is a radial gradient in CSS?

Definition and Usage. The radial-gradient() function sets a radial gradient as the background image. A radial gradient is defined by its center. To create a radial gradient you must define at least two color stops.

How do I create a linear gradient in CSS 3?

Creating CSS3 Linear Gradients To create a linear gradient you must define at least two color stops. However to create more complex gradient effects you can define more color stops. Color stops are the colors you want to render smooth transitions among.

What is the difference between radial and linear gradient?

If the linear colors are located perpendicular to the line that sets the direction, then the radial colors diverge from the specified center, and the gradient can take the form of a circle or ellipse. In addition to colors, you can set the gradient shape, position, and size.

How do I create a radial gradient in illustrator?

To create a radial gradient you must also define at least two color stops. By default, shape is ellipse, size is farthest-corner, and position is center. The following example shows a radial gradient with differently spaced color stops: The shape parameter defines the shape.


1 Answers

Set your body height to 100%, your body element is empty, and thus it doesn't have any height, the background is simply repeated there.. Bad Demo

html, body {
   height: 100%;
}

Demo

Also, you background will be repeated, so you will need background-attachment: fixed; as well as background-repeat: no-repeat

Demo 2

like image 189
Mr. Alien Avatar answered Sep 30 '22 12:09

Mr. Alien