Well, what do you want to make? A graniet or a gradinet?
a gradinet. I want that border to be gradinet.
If you wish to make a simple gradient from side to side of the rectangle or similar and the border is a stroke no fill path (you may copy the path if it is a stroked and filled rectangle, remove the fill of the copy, and work with the stroke), you may Object>Path>Outline Stroke and apply the gradient.
If you wish something else, there is a different solution for that, too.
Personally, I don't believe there is any easy way to accomplish this, But I may be wrong.
I would create 2 rectangles, One slightly larger and underneath the smaller of the two, Remove the stroke, And fill it with a Gradient. Then fill the rectangle on top with a white. Unless you required the stroke to be a gradient, This should work.
If you have any questions, I'll try my best to help.
Gradient.jpg 71.9 K
Without breaking a sweat I can think of three different ways to envision a gradient applied to the stroke of a rectangle. Each is different, each can be called a gradient, and each can be achieved a number of ways, none of which is applicable to another.
Which of these gradients is what you are after?
1. Window: Gradient, and define your gradient
2. Draw a box with white fill no stroke
3. Window: Appearance, Add New Fill
4. Double Click on lower fill in Appearance. Then click on the gradient color in Gradient Panel.
5. In FX flyout at bottom of Appearance, Convert to Shape, Rectangle, select Relative and specify thickness of border
You now have white box with gradient border.
Also note: if you need the white fill to be none, no problem. With box selected, in Appearance, select the white fill and change Opacity to Multiply. The white will disappear but that's OK. With the item still selected, Object: Group.
Now, Window: Layers: New Layer. Click the little circle icon beside this new layer in Layers Panel. In Appearance click on Opacity, then check "Knockout Group".
Select the box. In Layers Panel, click on the tiny colored icon beside "Group." Drag this UP to the new layer just created above. This should make your gradient border look correct again.
Now click back on the bottom layer. Any art you create here will show through the white box on the layer above, but not the gradient border.