radial-gradient circle vs ellipse: why it looks stretched

PublishedToolRadial Gradient Generator

Contents
  1. Why gradients on buttons and banners look squished
  2. How circle and ellipse handle element proportions: try it yourself
  3. Common sticking points
  4. The takeaway
  5. FAQ

When you set the shape of a radial gradient to ellipse, the color may not spread out evenly in all directions. Instead, it can look stretched toward one side whenever the element isn't square. Nothing is wrong with your gradient code. This is just how CSS works: an ellipse follows the element's width-to-height ratio. Comparing how circle and ellipse each handle that ratio clears it up.

Summary ① radial-gradient() has two shapes, circle and ellipse, and they treat the element's proportions differently. ② Ellipse reflects the element's width and height separately, so it looks stretched on anything that isn't square. ③ Circle always draws a perfect circle with the same horizontal and vertical radius, no matter the element's proportions.

Why gradients on buttons and banners look squished

People often put a radial gradient on a wide, short element like a card header or a button to get a soft glow. But if you apply it with the shape set to ellipse, you may get a shape that spreads long in one direction instead of the round glow you expected.

Changing color stops or colors won't fix that stretched shape. Color stops only decide which color appears where. Whether the gradient spreads as a circle or an ellipse is controlled by a completely different value — the shape.

How circle and ellipse handle element proportions: try it yourself

You can see the difference in the browser without any tool. Make one square element and one wide element, then apply a radial gradient with the same two colors to each.

.square { width: 200px; height: 200px;
  background: radial-gradient(ellipse at center, #fb923c 0%, #0ea5e9 100%); }

.wide { width: 400px; height: 120px;
  background: radial-gradient(ellipse at center, #fb923c 0%, #0ea5e9 100%); }

On the square element the color spreads evenly in every direction. On the wide element, the same code produces a shape stretched much farther horizontally, because the ellipse's horizontal and vertical radii are each set separately to match the element's width and height.

Now change ellipse to circle on both elements and save. The difference is obvious. The gradient no longer stretches on the wide element — it always draws a full circle. The catch is that the more elongated the element, the more the circle's edges fall outside the element, so you may only see the part cut off inside it.

Check it in the Radial Gradient Generator. Instead of writing the code by hand, saving, and refreshing over and over, you can switch the shape with one click and see the result right away.

Radial Gradient Generator

Free · no sign-up · generate CSS right in your browser

Common sticking points

SymptomCause
The gradient always looks squished when the shape is set to ellipseEllipse reflects the element's width and height separately, so it stretches.
The gradient's edges still don't show after switching to circleCircle always tries to stay a perfect round shape, so on a very elongated element the circle's edges fall outside the element and you only see the inner colors.
Moving the position away from the center doesn't change the shape (circle or ellipse)Position only sets where the gradient's center starts. Whether the shape is a circle or an ellipse is decided separately by the shape value.
Adding more color stops doesn't fix the squishingThe number and position of color stops only set where the colors change. They don't affect the overall shape of the gradient.

The takeaway

  • A radial gradient has two shapes, circle and ellipse, and they reflect the element's proportions differently.
  • Ellipse reflects the element's width and height separately, so it looks stretched on anything that isn't square.
  • Circle always draws a perfect circle with the same horizontal and vertical radius, regardless of the element's proportions.
  • Color stops and the position value only set where colors appear and where the center sits. The shape value decides separately whether the gradient is a circle or an ellipse.
  • On a square element both shapes give the same result, so the stretching problem only shows up when the element isn't square.
Radial Gradient Generator

Free · no sign-up · generate CSS right in your browser

FAQ

What exactly is the difference between circle and ellipse in a radial gradient?

A circle has the same radius in every direction from the center, so it always draws round, regardless of the element's width-to-height ratio. An ellipse sets its horizontal and vertical radii separately to match the element's width and height, so if the element isn't square, the shape stretches by that same ratio.

Does changing the position also change the shape?

No. Position only sets the center coordinates where the gradient starts. Whether it spreads from that center as a circle or an ellipse is a separate setting decided by the shape value, wherever you place the center — top left or middle.

Do circle and ellipse look the same on a square element?

Yes. When the element's width and height are equal, the ellipse's horizontal and vertical radii are equal too, so the result looks the same as choosing circle. The stretching difference only shows up once the element is no longer square.

Which shape should I choose so my gradient doesn't get squished?

If you want a consistently round look regardless of the element's proportions, choose circle. Just keep in mind that the more the element deviates from a square, the more the circle's edges fall outside the element, so a wider band only shows the inner colors.

This article was adapted from our Korean original. Read the Korean original

Related articles

  1. Media Query Breakpoints: Why Mobile and Desktop Layouts DifferSee why the same site looks different on a phone and a desktop, and how to build your own CSS media query breakpoints from screen widths.
  2. Why Profile and Banner Images Get Cropped on Every PlatformSame photo, different crop. Why YouTube banners and Instagram profiles lose edges, how safe zones and circular crops work, and how to check sizes free.
  3. SVG vs CSS Blob Shapes: Why Curves Differ and How to Plot ThemCSS border-radius blobs top out at 4 curves. SVG path blobs can have as many as you want. See why, and the math to place the points yourself.
  4. SVG Icon Color Not Changing With CSS: Fix the fill and strokeSVG icons ignore CSS color because fill and stroke are hard-coded in the file. See why inheritance breaks, and how to change the values in the SVG source.
  5. SVG Filter Primitives and feColorMatrix: Formulas ExplainedHow feColorMatrix recalculates RGBA with a 4×5 matrix, and how feGaussianBlur and feComponentTransfer build blur, brightness, contrast, and invert effects.
  6. SVG Filter vs CSS Filter: Where the Effect Gets SavedOne test shows the difference: CSS filter effects disappear when the file leaves the page, while SVG filters stay saved inside the file itself.

Related tools