Is there a better way of drawing a border inside a vector object other than drawing one vector shape on top of another and then resizing (as in my example image below)? I'd prefer to set it on the actual main object itself so when I resize it retains the correct spacing etc.enter image description here

  • It would be good to say what methods you have already attempted. There are several ways to accomplish what you're asking and it would be good to know if any of them didn't specifically work.
    – paulmz
    Commented Oct 9, 2015 at 15:12
  • ahh, yes, apologies. So, I tried the approach pretty much as described below, creating two shapes, one on the top of the other (the top one with a dashed border). What I was really wondering was whether I could set the border to be inset, say 5px, just using one shape, if that makes sense.
    – user52229
    Commented Oct 9, 2015 at 15:30
  • Sorry, you can't combine two separate shapes and maintain them as separate colors. The "group" option is the best practice for this. On the off-chance that the dashed line doesn't need to be a specific color, you could cut it out of the background rectangle with Pathfinder. Then the dotted line would be part of the rectangle, but the dotted line would also be transparent.
    – paulmz
    Commented Oct 9, 2015 at 16:10
  • 1
    Possible duplicate of Adding dashed lines inside a shape in Illustrator
    – Cai
    Commented Feb 5, 2017 at 16:52

2 Answers 2


There are a few ways to achieve this, but the simplest way is usually the best:

  1. Draw your background rectangle.
  2. Draw your "border" rectangle.
  3. "Group" the two rectangles and they will resize together.

I've got a sort of cheat for doing this. You can have it all on one object, you just set two strokes in the Appearance menu (Illustrator). The first one is your dashed line, set it to Inside and let it extend to, let's say, 6px. Then, make the second one, set it to Inside and make it a pixel or two thinner. Apply the fill colour of the rectangle to it and put it on top of the first one. And that's it! You can resize is as much as you want. It can also be any shape, even a custom one. Hope this helps (:

  • 1
    If you're using the appearance panel you can just add an offset path effect to the stroke you want inset (see my answer here).
    – Cai
    Commented Feb 5, 2017 at 21:38
  • Oh, man! That's true, I hadn't thought of the fx pannel! This is great, thank you (:
    – Mat D
    Commented Feb 8, 2017 at 1:13

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.