Setting the size of the radial gradients using CSS

CSSWeb DevelopmentFront End Technology

To set the size of the radial gradient, use the radial-gradient() function. This function sets a radial gradient as the background image. The second parameter in the function is to be set as the size you want as in the below example −

background-image: radial-gradient(40% 50px at center,rgb(30, 255, 0),rgb(0, 195,
255),rgb(128, 0, 32));

Possible values are farthest-corner (default), closest-side, closest-corner, and farthest-side. Following is the code for setting the size of the radial gradients using CSS

Example

 Live Demo

<!DOCTYPE html>
<html>
<head>
<style>
body {
   font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
#radial {
   height: 200px;
   width: 200px;
   background-image: radial-gradient(40% 50px at center,rgb(30, 255, 0),rgb(0, 195,
   255),rgb(128, 0, 32));
}
</style>
</head>
<body>
<h1>Radial Gradient Size Example</h1>
<div id="radial"></div>
</body>
</html>

Output

The above code will produce the following output −

raja
Published on 11-May-2020 13:53:09
Advertisements