To make a linear gradient in Photoshop, select the Gradient Tool, set its type to Linear, and drag across the layer or selected area.
Photoshop paints the result as image pixels on the active layer. If the design will become a web background, the reliable workflow is to finish and approve it in Photoshop first, then reproduce its colors, direction, and stop positions in CSS.

Choose the layer that will receive the gradient
Select the layer that should contain the gradient before using the tool. A selection can restrict the effect to a particular area, while a duplicated layer keeps the original artwork recoverable. For a background that may need later adjustments, choose Layer > New Fill Layer > Gradient so the effect remains separate from the artwork and can be masked or repositioned.
Create a linear gradient in Photoshop
Follow these steps for a direct gradient created with the Gradient Tool:
- Select the target layer or make a selection. Open the document, choose the appropriate layer, and use a selection if the gradient should appear only inside a defined shape or image area.
- Open the Gradient Tool and choose Linear. In the options bar, select the Gradient Tool, then click the Linear gradient type rather than Radial, Angle, Reflected, or Diamond.
- Open the Gradient Editor and define the stops. Click the gradient preview in the options bar. Select each color stop below the ramp, change its color in the swatch, and set its location as a percentage. Add intermediate stops when the design needs more than one transition.
- Set the application options. Start with Normal blend mode and 100% opacity for predictable color reproduction. Enable Dither only if the final display or export shows unwanted banding.
- Drag the gradient onto the canvas. Click at the starting point and drag toward the ending point. The drag determines the gradient line and its direction. Hold Shift while dragging to constrain the direction to 45-degree increments, and extend the drag beyond the visible area when the canvas needs complete coverage.
- Check the orientation. If the colors run in the wrong direction, use the Reverse control in the options bar. Compare the result with the selected colors because blending, opacity, and the layer beneath it can affect how the gradient appears.
- Preserve the editable source and export. Save the layered document as a PSD file, then export a flattened raster image in the format required by the destination.
Choose a gradient method you can edit later
The method you choose determines how easily the gradient can be revised after it reaches the design.
| Photoshop method | Best suited for | Editing behavior |
|---|---|---|
| Gradient Tool on a raster layer | A quick, one-off painted gradient | The result becomes pixels; changing the preset later does not rewrite existing painted pixels. |
| Gradient Fill layer | A reusable or responsive background | Its gradient settings, opacity, blend mode, and mask remain separate from the artwork. |
| Gradient Overlay layer style | Adding a gradient to existing text, shapes, or imagery | The overlay’s angle, stops, opacity, and blend mode can be revised through the Layer Style controls. |
Use a Gradient Fill layer when later color or position changes are likely. Use Gradient Overlay when the gradient needs to affect an existing design element without replacing its pixels.
Control color and transparency stops
The Gradient Editor provides separate controls for color and opacity, so each transition can be checked independently.
- Color stops appear below the gradient ramp. Click a stop to select it, change its swatch, or enter a new location percentage.
- Opacity stops appear above the ramp. Move them or adjust their values to fade a color toward transparency without changing its underlying color.
- The middle stop controls where the main blend develops. Moving it changes the balance between the first and second color rather than merely shortening the gradient.
- Adjacent stops at the same location create a hard transition. This is useful for a distinct band, although it is not a smooth blend.
Inspect the gradient at its intended output size, not only while zoomed in. Fine color changes that look smooth on the canvas can become visible bands after scaling or export.
Build the matching CSS declaration
The CSS Gradient Generator is a separate web-handoff tool, not a Photoshop plug-in: it does not import a PSD, create a Photoshop gradient preset, or modify an open document. After the Photoshop design is approved, use the CSS Gradient Generator to reproduce the approved gradient as CSS that can scale cleanly on the web.
- Set an angle from 0 through 360 degrees. Choose the direction independently from the Photoshop drag rather than assuming its numeric angle has the same meaning.
- Choose three six-digit hexadecimal colors. Enter the corresponding color values as six-digit hex values, such as a starting color, a midpoint color, and an ending color.
- Place the three percentage stops in ascending order. Keep each stop between 0% and 100%. Equal neighboring stops are allowed and create a hard transition, while descending stops are rejected. CSS can represent stops outside the visible range, but that advanced behavior is intentionally outside the generator’s controls.
- Copy the declaration and test content contrast across the full gradient. The preview uses the exact linear-gradient value returned by the generator, so what appears in the preview and what appears in the copied declaration share one source.
A CSS linear gradient is an image generated by the browser. Its direction defines the gradient line, while its color arguments anchor colors at positions along that line. The MDN gradient reference explains the syntax, and the CSS Images specification defines the behavior of linear gradients.
| CSS angle | Gradient line points | Color progression |
|---|---|---|
| 0° | Up | Bottom to top |
| 90° | Right | Left to right |
| 180° | Down | Top to bottom |
| 270° | Left | Right to left |
| 360° | Up, equivalent to 0° | Bottom to top |
Intermediate angles create diagonals, but their apparent slope depends on the dimensions of the gradient box. The generator intentionally produces one linear layer and omits radial, conic, repeating, transparency-alpha, and custom interpolation-space controls. A Photoshop design with more than three color anchors or meaningful alpha transparency therefore cannot be reproduced exactly by this focused tool.
The copied declaration uses the background shorthand. If an existing component also needs a background color, image layers, position, or size, integrate the gradient carefully or switch it to background-image so the shorthand does not reset other background subproperties. Everything runs locally in the current tab: values are not uploaded or saved, and no account or dependency is required.
Check the result before delivery
In Photoshop
- Inspect every stop at the actual delivery size and check for clipping, unwanted hard edges, or visible banding.
- Place the gradient behind real text and controls, then check legibility across the complete text area rather than sampling one color.
- Keep the layered PSD as the editable source and use a flattened export only for destinations that require a raster image.
In the browser
- Test the CSS at responsive sizes because changing the element’s aspect ratio can change the apparent diagonal.
- Check contrast across the full gradient. The generator does not calculate contrast, and browser color interpolation and display characteristics can alter the perceived midpoint.
- Use a solid fallback or overlay when strong colors compete with controls, and never communicate status through color alone.
- Verify the design in themes, forced-color modes, printing, and screenshots that form part of the delivery requirements.