How would I make the radius 200px in width and height? I've read that this can be done in pixel units, but every attempt has failed.
background-image: -webkit-radial-gradient(75% 100%, circle farthest-corner, #ffffff, #ff7ae9 33%);
background-image: -o-radial-gradient(75% 19%, circle farthest-corner, #ffffff, #ff7ae9 33%);
background-image: -ms-radial-gradient(75% 19%, circle farthest-corner, #ffffff, #ff7ae9 33%);
background-image: radial-gradient(75% 19%, circle farthest-corner, #ffffff, #ff7ae9 33%)
background-image: -moz-radial-gradient(75% 19%, circle farthest-corner, #ffffff, #ff7ae9 33%);
Select the Radial Gradient tool by clicking its icon in the column on the right or pressing the R key. Drag over the area that you want to adjust. The point where you start to drag will become the center of the radial gradient. Drag the sliders in the Radial Gradient panel to make your adjustments.
The createRadialGradient() method creates a radial/circular gradient object. The gradient can be used to fill rectangles, circles, lines, text, etc. Tip: Use this object as the value to the strokeStyle or fillStyle properties.
radial-gradient() The radial-gradient() CSS function creates an image consisting of a progressive transition between two or more colors that radiate from an origin. Its shape may be a circle or an ellipse. The function's result is an object of the <gradient> data type, which is a special kind of <image> .
edit: added all the vendor prefixes to make it clearer
background-image: -moz-radial-gradient(50px 100px, circle farthest-corner, #ffffff, #ff7ae9 200px);
background-image: -webkit-radial-gradient(50px 100px, circle farthest-corner, #ffffff, #ff7ae9 200px);
background-image: -o-radial-gradient(50px 100px, circle farthest-corner, #ffffff, #ff7ae9 200px);
background-image: -ms-radial-gradient(50px 100px, circle farthest-corner, #ffffff, #ff7ae9 200px);
background-image: radial-gradient(50px 100px, circle farthest-corner, #ffffff, #ff7ae9 200px);
In this example the '200px' is the size of the circle, any standard CSS units such as px, em or percentages are fine.
The '50px 100px' is the position of the centre of the circle, it works the same way as background-position so values like 'left top' are fine too.
There are a few online generators that can help you with all the vendor specific prefixes.
p.s.
@Mohsen pixel values are fine, MDN says:
either a percentage between 0% and 100% or a length along the gradient axis
If you click on 'length' it says
The CSS syntax for length is a number followed immediately by a unit. Space between the number and the unit is not allowed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With