HTML - Corp and re-size SVG Image

时间:2016-06-06 14:20:02

标签: html css svg

I have a following svg from which I want to display only one icon and re-size it

image

I visited couple of posts, but none of them is working for me.

I tried by following way:

var frameColorInfo  = [String:UIColor]()
frameColorInfo["frameColor"] = logs.frameColor//.first
frameColorInfo["matColor"] = logs.matColor//.first
NSNotificationCenter.defaultCenter().postNotificationName("FrameSizeThings", object: nil, userInfo: frameColorInfo)

It would be great If somebody can help me with a working fiddle!

1 个答案:

答案 0 :(得分:0)

SVG精灵表可以像这样轻松使用:

<use xlink:href="#icon-pacman"></use>

https://jsfiddle.net/xL8d31n9/

它比css sprite表更容易。

参考:https://css-tricks.com/svg-use-external-source/