You set out to make a clean two-tone banner and got a soft blue fade instead. Or you built a smooth gradient and could not work out why the color melted from one shade into the next when a neighbouring design snapped cleanly between the same two colors. Both results come from one single fact: a gradient does not know whether you wanted a blend or an edge. You tell it with stop positions.

This guide explains the difference between blended gradients and hard stops, shows how stripes and bands are built from repeated hard stops, and walks through both in the free CSS Gradient Generator on Ovatly, which runs in your browser.

Contents

  • Quick answer
  • What a blend actually is
  • What a hard stop does differently
  • Stripes and bands are repeated hard stops
  • How to build both, step by step
  • Worked example: turning a blend into two bands
  • Limitations and honest tradeoffs
  • Common mistakes
  • FAQs
  • Conclusion
  • References

Quick answer

For a blend, place two stops at different positions: the color changes gradually across the gap between them. For a hard stop, place two stops at the same position: the color changes instantly at that line, with no transition at all. Stripes and bands are hard stops repeated, alternating colors at shared positions. In the CSS Gradient Generator, set a linear gradient, add up to six stops, spread their positions for a blend or stack two stops on one position for an edge, then copy the single background declaration it produces.

What a blend actually is

A gradient is a row of color stops, each with a color and a position along the gradient line. Between two stops, the browser mixes the two colors in proportion to distance. A stop of #0ea5e9 at 0% and a stop of #2563eb at 100% means the full span of the element is one long negotiation between sky blue and deep blue, passing through every mixture in between.

Move the second stop to 60% and the same negotiation happens in a shorter space: the blend gets steeper, and past 60% the color stays at #2563eb. The gap between stop positions is the blend. A wide gap makes a gentle fade. A narrow gap makes an abrupt fade. No gap at all is something different.

What a hard stop does differently

When two stops share exactly the same position, there is no distance across which to mix. The first color holds right up to that position, and the second color takes over immediately after it. The result is a hard stop: a crisp line where one flat color meets another.

This is not a separate feature or a special mode. It is the same stop system with the gap closed to zero. Every gradient type the generator builds, linear, radial or conic, obeys the same rule. In a linear gradient the edge is a straight line across the element. In a radial gradient it is a clean ring. In a conic gradient it is a wedge boundary, which is the trick behind simple pie charts drawn in pure CSS.

Stripes and bands are repeated hard stops

A stripe pattern is just this idea repeated. To make two bands, the first color runs from 0% to a shared position, and the second from that same position to 100%. That takes four stops, not two: each color appears at the start of its band and at the end of it.

A third band takes six stops, the maximum the generator allows. So with two alternating colors, the generator can build up to three bands in a single declaration. More stripes than that means writing additional stops by hand in your stylesheet.

Because positions are percentages rather than fixed pixels, the bands scale with the element: a banner 400 px tall and one 900 px tall show the edge at the same relative place, sharp at both sizes.

How to build both, step by step

  1. Open the CSS Gradient Generator and choose the linear type.
  2. Set the angle. For horizontal bands stacked down the element, 180deg runs top to bottom. For vertical stripes side by side, 90deg runs left to right.
  3. For a blend, add two stops at spread positions, such as 0% and 100%, and pick a color for each.
  4. For a hard stop, add a stop and set it to exactly the same position as its neighbour, then give the pair different colors.
  5. Watch the preview as you work. It is a live CSS rendering, not an image file, so what you see is what the declaration will paint.
  6. Copy the background declaration and paste it into your stylesheet.

Worked example: turning a blend into two bands

Start from a simple reference blend: linear, at 135deg, with #0ea5e9 at 0% and #2563eb at 100%. The generator produces this:

background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);

Across the diagonal, the color drifts the whole way from sky blue to deep blue. Now turn it into two bands meeting in the middle. Keep the angle and set four stops: #0ea5e9 at 0%, #0ea5e9 at 50%, #2563eb at 50%, and #2563eb at 100%. The output becomes:

background: linear-gradient(135deg, #0ea5e9 0%, #0ea5e9 50%, #2563eb 50%, #2563eb 100%);

The two stops at 50% are the whole trick: the sky blue runs flat to the halfway line, and the deep blue starts there with no mixture between them. One detail worth knowing: the generator sorts stops by position in the output even if you entered them out of order, so the output list is always tidy. But sorting cannot rescue a hard stop typed as 50% and 51%. That one percent is a thin blend, not an edge.

Limitations and honest tradeoffs

Three honest limits. First, six stops is the ceiling, which caps generated stripe patterns at three two-color bands; anything denser is hand-written CSS. Second, every stop is a solid hex color. The generator cannot fade a band out to transparent, so stripes that dissolve softly are outside what it emits. Third, if you need a band of an exact pixel height regardless of how tall the element grows, a gradient is the wrong tool and a plain bordered block is the honest answer.

Common mistakes

  • Stops at 49% and 51% instead of the same position. That small gap is a narrow blend that reads as a fuzzy seam on large elements. Set both stops to the identical number.
  • Expecting two stops to make a stripe. Two stops can only blend. A single band split needs each color twice, four stops in total.
  • Forgetting the angle. At 135deg the bands run diagonally. If you wanted level bands, the angle is 180deg, and if you wanted upright stripes, it is 90deg.
  • Judging the edge only at one size. Percentage edges hold at any size, but a near-miss blend shows more as the element grows. Check the design at its largest real size.
  • Trying to fade a stripe out. Stops are solid hex colors with no transparency. Plan a hard edge, or write the alpha version by hand.

FAQs

What is a hard stop in a gradient? A hard stop is what you get when two color stops sit at exactly the same position. The first color holds right up to that position and the second takes over immediately, so the change is a crisp line instead of a fade.

How do I make stripes with a linear gradient? Alternate the colors at shared positions. One color runs from 0% to 50%, the second from 50% to 100%, which takes four stops because each color appears at the start and the end of its band. Add another shared position for a third band.

Why do my stripes look soft instead of sharp? The two stops at the boundary are probably a percent or two apart rather than identical, which creates a narrow blend instead of an edge. Set both stops to exactly the same position and the line sharpens.

Do hard stops work in radial and conic gradients too? Yes. The position rule is the same in all three types the generator builds. In a linear gradient the edge is a straight line, in a radial gradient it is a ring, and in a conic gradient it is a wedge boundary.

Will a hard stop stay sharp when the element resizes? Yes. Stop positions are percentages, so the edge sits at the same relative place on a small element and a large one, and because the gradient is rendered as CSS rather than an image, there is nothing to blur.

Conclusion

Blends and hard stops are the same mechanism with one variable changed: the distance between stop positions. Spread them for a fade, stack them for an edge, and repeat the stacking for stripes and bands. The CSS Gradient Generator makes both easy to prototype because the preview is the real CSS, and the copied declaration is the finished thing. If your design instead needs a gradient that dissolves over a photo, our guide to layering a gradient over a photo for readable headlines covers that technique and its limits. For more guides in this series, see our Website and Webmaster Tools guides.

References