Here's what I have...


The top and bottom half are two separate objects each with their own gradient.

I would like to remove the curved horizontal line going across the shape, then I would like to add a gradient to the rounded rectangle stroke. I thought I had found an answer to the first part here(drag stroke below contents) which I applied here but in addition to being kind of a work around(the horizontal line still exists), I am still unable to add a gradient to the stroke. The rest of what I've googled regarding removing part of a stroke instructed use of the pen tool to add and then delete anchor points on the part of the stroke that I want removed but I am not clear on how to do this, whenever I tried, I ended up also removing the barrier between the two halves of the object which I do not want to do.

I have tried "Object > Path > Outline Stroke" multiple times in order to add a gradient to the stroke but am still left with the same two paths underneath the object's group. I expected the stroke to be turned into a new path. Any help as to how to

  1. Remove the horizontal line stroke from existence while still maintaining separate gradients for the top and bottom halves of the object


  1. Add a gradient to the stroke surrounding the rounded rectangle sans the horizontal line

would be greatly appreciated.

1 Answer 1


In the Appearance Panel, click-drag the stroke below the Contents item. That will move the stroke behind the objects.

This essentially gives you an outer stroke around all the objects within a group. Apply this appearance to a layer and you'll have a stroke around everything on that layer.

enter image description here

Then use Object > Expand Appearance, then Object > Expand - check ONLY the Stroke option and hit OK. You are then left with a shape rather than a stroke. This is expected. You can then apply a gradient fill to the resulting shape.

This method works. It can be a bit cumbersome because you're essentially creating new paths you need to manage.

However, Illustrator CS5 has no option to create gradients on strokes. So you can't really have a gradient stroke. You can only have gradient fills.

Regarding the path which crosses the shape. You can't remove that if you want the overlaying gradient. Many well-constructed Illustrator objects need closed paths. Since that specific path shapes the edge of the top gradient, you can't remove it. However, this should be of no consequence. You only see the path because the object is highlighted and Illustrator is highlighting the path edge. When you de-select the object you only see the edge of the gradient, not the path.

Here's possibly a better method....

Rather than using a stroke (since you want a gradient) use an offset fill.

  • Remove the stroke entirely.
  • Add a new Fill via the Appearance Panel and move the fill below the Contents item.
  • With the new fill highlighted in the Appearance Panel, choose Effect > path > Offset Path and enter a value (the width you want the stroke to appear to be)

You can then have a gradient around the exterior of the shape without the additional paths of expanded strokes.


I used red/orange to show the offset fill a bit better.

Note: In Illustrator CS6 you can simply apply a gradient to a stroke. However, only CS6 or newer versions support gradients on strokes.

*screenshot from Illustrator CS6 but it should be the same as CS5 panels/dialogs.

  • Thank you! Object > Expand worked but using Offset path does work better as it allows me to have one consistent gradient. Thanks for the note about CS6 as well I had no idea, I'll have to upgrade soon.
    – Ronald
    Commented Dec 19, 2012 at 1:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.