Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVG nine-slice scaling

Tags:

svg

How could one obtain nine-slice scaling in SVG? Specifically, I'm looking for a way to define SVG objects that behave like nine-sliced objects when resized (some elements maintain their dimension, and others scale with the container).

like image 296
Dan Burzo Avatar asked Mar 03 '12 17:03

Dan Burzo


1 Answers

If you meant to apply it to an svg, then the CSS3 Borders and backgrounds spec should help you do that if you reference an svg.

If you meant you wanted to do it inside an svg file, then you might be able to use a <pattern> (possibly combined with some nested <svg> elements) to do something similar. Nested <svg> elements might be another way to do this, see e.g this example. Alternatively use 9 <use> elements with different transforms, each having a different clip-path applied.

like image 125
Erik Dahlström Avatar answered Oct 02 '22 08:10

Erik Dahlström