Skip to content

Install ALink Tools

Free browser tools for images, PDFs, media, text and web checks. Most tools process files locally on your device.

  1. Tap the Share button in the Safari toolbar.
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add. ALink Tools then opens from your Home Screen like an app.

CSS Gradient Generator

Choose a linear or radial gradient, add color stops, and copy a CSS background-image rule. The preview in this tab uses the same CSS string as the output box.

Runs in your browserRuns in your browserLinear and radialPlain CSS
1

Input

Color stops
Preview
2

Result

How to use CSS Gradient

  1. Choose a gradient typePick linear or radial, set the angle or the center point, and add two or more color stops.
  2. Choose the output shapeTurn on Repeating if you want the stops to tile. Watch the preview as you edit.
  3. Copy or downloadCopy the background-image rule and paste it into your stylesheet. You can format the rule later in CSS Formatter.

Limits and how it works

  • You can use 2 to 8 color stops.
  • Color stops accept hex colors and CSS rgb(), rgba(), hsl(), and hsla() values. Named colors and newer functions such as oklch() are not parsed here.
  • Repeating gradients use your last stop position as the size of one repeat cycle. If the last stop is at 100%, the repeat may not be visible in the preview.
  • The tool outputs a CSS background-image value. It does not generate vendor prefixes or older Internet Explorer gradient filters.

How these gradients are written

This page writes standard CSS gradient functions in your browser and does not use a third-party color library. Linear gradients use an angle in degrees, with 0deg pointing up and 90deg pointing to the right, as defined in CSS Images Module Level 3. Radial gradients use a circle or an ellipse and a center position.

The preview applies the same CSS string shown in the output box. Color stops accept hex colors and rgb(), rgba(), hsl(), or hsla() values. Positions are percentages from 0% to 100%.

This is not CSS Formatter, which formats or minifies a stylesheet, and it is not Color Palette Generator, which builds a set of related colors. You can paste the result into CSS Formatter if you want it wrapped in a larger rule set.

Frequently asked questions

Is my CSS uploaded?

No. Everything runs in your browser tab with JavaScript. Nothing you type, paste, or open is sent to a server, logged, or stored by ALink Tools.

Is this the same as CSS Formatter?

No. CSS Formatter formats or minifies a stylesheet you already have. This page builds a linear or radial gradient and gives you a background-image rule.

Does this generate conic-gradient CSS?

No. This page writes linear-gradient and radial-gradient functions, including the repeating- forms. It does not generate conic-gradient.

How do repeating gradients work?

When Repeating is on, the CSS uses repeating-linear-gradient or repeating-radial-gradient. The distance to the last color stop is the length of one cycle. Use a last stop below 100% if you want the pattern to repeat inside the preview.

Related tools

All tools