Closed Fastidious closed 7 years ago
OK, I found a way to do it. The trick is to use xmlns="http://www.w3.org/2000/svg”
, and I also base64
encode it. That works. Now I have run into another issue, which I believe it can’t be fixed. It seems stroke=“currentcolor”
will not work, the icon will be rendered black. Does anyone knows a way so that the icon will inherit the colour?
Since you are rendering the SVG as an image you won't be able to manipulate fills or stroke from DOM.
Hi ! I am new to html, css and others, and I am sorry if my question is not appropriate.
I search a lot to fine hoe could I load the SVG icons in to a CSS file and then use it in a project or a php file. I don't want to have the SVG tag inside my php or html tags.
Before I use glyphicon with bootstrap, inside a span tag. Can I load it in a span/id or class and the source should be out side of the file:
<link href="../style/css/bytesize.css" rel="stylesheet">
Thank you!
@saboorazizi You can load the entire SVG library once (even as n external file for cache advantages), and use the
<use xlink:href="/icons/bytesize-icons.svg#i-search" />
Note: This doesn't work for IE, so you'd you need to use a polyfill like SVG4Everybody: https://github.com/jonathantneal/svg4everybody
Hi there! I am not sure this question relates to the project directly, but I wonder if someone will have an answer. Right now I am using:
To add a PNG on external URLs. How could I go to replace the PNG with a bytesize icon? I have tried:
Using many combinations (replacing " with ', escaping them, \", \') on the
<svg>
to no avail.Update:
I tried using one of the icons in an image tag, and it shows broken. I used:
Yet, trying with other SVGs work: