October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

How to Create a Radial Gradient in CSS

Create CSS radial gradients with radial-gradient(). Set their shape, size, center and color stops, or use repeating-radial-gradient() for rings.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use CSS radial-gradient() as a value for background or background-image. For example, this creates a gradient centered in the element, transitioning from white to blue:

.card {
  background-image: radial-gradient(circle at center, #fff 0%, #4b6cb7 65%, transparent 100%);
}

radial-gradient() produces an image, not a color, so it does not belong in background-color.

Radial gradient syntax

The general form is:

radial-gradient([<shape> || <size>] [at <position>], <color-stop-list>)

Shape, size and position are optional controls before the comma. The color stops follow the comma. For example:

.panel {
  background-image: radial-gradient(ellipse closest-side at 30% 40%, white, royalblue 70%, transparent);
}

This specifies an elliptical gradient whose ending shape reaches the nearest side, with its center at 30% across and 40% down the element.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What the defaults do

If you leave the controls out, CSS uses an ellipse, extends the gradient to the farthest corner, and places its center in the middle:

.card {
  background: radial-gradient(#e66465, #9198e5);
}

Choose the shape, extent and center

Circle or ellipse

Use circle for a circular gradient and ellipse for an axis-aligned elliptical one. The default ellipse adapts to the element’s proportions; a circle keeps the same radius in every direction.

Size keywords or explicit lengths

The extent keywords describe where the gradient’s ending shape reaches in relation to the element:

  • closest-side: reaches the nearest side.
  • farthest-side: reaches the farthest side.
  • closest-corner: reaches the nearest corner.
  • farthest-corner: reaches the farthest corner; this is the default.

You can also set an explicit size. For example, circle 12rem sets a circular ending shape with a 12rem radius:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
.glow {
  background: radial-gradient(circle 12rem at 50% 50%, #7c4dff, transparent);
}

Position the center

After at, use the familiar CSS position syntax. For example, at 25% 30% positions the center a quarter of the way across and 30% down; at top right places it at that corner. If omitted, the center is centered.

Control the transition with color stops

Each color stop has a color and can have one or two positions. Positions are measured along rays from the gradient’s center toward its ending shape: 0% is the center, and 100% is where the ray meets that shape. CSS distributes stop positions that you leave unspecified according to its gradient rules.

Make a soft spotlight

Use gradual transitions and transparency to make a glow that blends into whatever is behind it:

.spotlight {
  background: radial-gradient(ellipse at 30% 20%, #fff8 0%, #77aaff66 35%, transparent 70%);
}

Make crisp rings or boundaries

Adjacent stops at the same percentage create a sharp color boundary rather than a gradual transition. Stops with two positions can define a solid band:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
.badge {
  background: radial-gradient(circle, #ffcf33 0 58%, #d85624 58% 60%, transparent 60%);
}

The colors and measurements in these examples illustrate the syntax; they are not tested design recommendations.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Use repeating rings when the pattern should continue

A gradient’s concrete dimensions match the element it is applied to; it has no intrinsic dimensions or preferred aspect ratio. To repeat rings outward through the background, use repeating-radial-gradient():

.rings {
  background: repeating-radial-gradient(circle, #263238 0 8px, #80cbc4 8px 16px);
}

Troubleshoot common issues

  • The gradient does not appear: Check that you assigned it to background or background-image, not background-color.
  • The gradient looks elliptical: That is the default shape. Add circle before the comma if you want a circular gradient.
  • The center is in the wrong place: Set it explicitly with at <position> before the comma.
  • The edge lands in an unexpected place: The default extent is farthest-corner. Try a different size keyword or specify a length.
  • A transition is softer or sharper than intended: Adjust the stop positions. Use two adjacent stops at the same position for a hard boundary.
  • A newer color interpolation feature behaves differently between browsers: Basic radial gradients are widely available, but support can vary for newer syntax. Check compatibility for the particular feature you use.

Browser support and standards

The basic radial-gradient() function is broadly supported. MDN labels it Baseline Widely available and reports cross-browser availability since July 2015; that date describes availability, not a guarantee that every newer gradient-related syntax works everywhere. CSS Images Module Level 3 defines the core radial-gradient syntax, while current reference material also covers later CSS Color and CSS Images features.

Or skip the browser setup

If you need a screenshot of a page showing your gradient, ScreenshotNeo provides a website screenshot API. One GET request returns an image or PDF; its capture flow also handles cookie and consent banners before capture and removes known newsletter popups and chat widgets. For a general-purpose radial-gradient reference, you can use this example request:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. Bot checks, blank pages, timeouts and failed loads are not billed, and cache hits cost nothing; response headers indicate the page verdict and billing status. An MCP server provides screenshot tools for AI agents, and the free plan includes 1,000 screenshots a month without a card. Paid plans start at $5 for 3,000 shots. Sign up for ScreenshotNeo free.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.