36

I created a shape in Inkscape and set the border width to 1px.
The actual size is 100px however with a border it's 102px.

How can I set an inner border on the object, not outer? When using Photoshop, the type
is selectable (inner, outer or center border), however in Inkscape there isn't this option.

24

Inkscape doesn't support changing the type of stroke on an object, however there's
other ways to create the inner border or blur that you need.

One simple method is making a copy of the shape, with no fill and the chosen border (stroke).
This copy is given a clipping path so the extra (outer) part of its stroke can't be seen outside the
original shape. The path used to clip it is a second, unchanged copy of the original shape,
which doesn't appear as a normal/regular object.
To make sure these copies change when the original is edited, they can
each be a linked offset - also allowing them to be moved inside the original shape.

  1. create the shape and select it (F1)

  2. create a linked offset copy, which appears on top of it (Ctrl+Alt+J or Path menu)

  3. change the stroke (border) width to 2x what you need or set its offset
    magnitude/radius to move it to the inner edge of the outer shape border
    - with its node handle or XML attribute (built-in editor, units are pt not px)

  4. give this shape no fill and the chosen border colour - fill and stroke in object menu

  5. create a second linked offset copy of the original shape, leave it unchanged

  6. select this shape and the copy from step 3 (hold Shift key, drag mouse)
    - make sure that this shape is on top (z-order) - see manual page linked above

  7. set clip - use the Object → Clip → Set menu item

Then you should have a finished inner border.

  • How do I select pasted and stroke shape? Nothing happens with Shift. – Dima Jul 12 '15 at 9:33
  • @Dima See the above answer, that I've updated - you need to drag the mouse or click other objects when pressing the Shift key. Also, the following tutorial page, that can also be seen in the application, could be useful: inkscape.org/en/doc/basic/tutorial-basic.html. – Edward Dec 11 '17 at 12:23
  • That's amazingly non-intuitive, but works perfectly. – dgo Apr 4 '18 at 20:18
  • Hello year ago me, who forgot about this entirely. – dgo Oct 5 '19 at 18:49
16

An alternative workflow to the one presented by @cristian-ciupitu would be this:

  1. Create (or select) an object or a path with no fill. If you want, you can already set the stroke width (Shift+Ctrl+F), or fix this later.
  2. Duplicate (Ctrl+D) the object/path. This will create a duplicate on top of the original.
  3. Send the duplicate Lower (ObjectLower, or Page Down), so that you can...
  4. ... choose Select (arrow on the toolbar, or F1) and Shift+Click the object/path. As the "Lowered" duplicate was already selected, this will select the two identical objects/paths on top of each other. The status line at the bottom of the window should confirm this.
  5. Now choose ObjectClipSet.

Voila! Inner border!

You can now adjust the inner border width (Shift+Ctrl+F) if you want. Set the stroke width to twice your desired inner border width, as half of the stroke width will be clipped invisible.

If you think steps 3 and 4 are confusing, just drag around the two objects/paths to select them both, clip them as in step 5, and adjust the stroke width as desired. Works as well, but hey, clicking is cooler ;)

  • 5
    Essentially you're doing the same thing, but I find your directions easier to understand. – SMBiggs Jul 9 '17 at 6:06
9

Not sure if by "border" you mean "stroke" but it appears SVG standards don't allow for inner/outer strokes, and thus neither does Inkscape. It seems a common thing to do is fake it by duplicating the object and shrinking/growing it so you get the border you want. Though I don't imagine this would work as well for an inner border as an outer border.

Inkscape bug: Inner/outer/center stroke placement

3
  • Select the stroke and Path -> Stroke to path, now your stroke becomes a "shape"
  • Use Path -> Division to divide the shape into inner and outer parts.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy