Answer the question
In order to leave comments, you need to log in
Is it correct to use base64 encoded SVGs?
If I converted an SVG icon to base64, for example here b64.io , and use this cipher in CSS for the actual display - what is the possible drawback of this method? And one more thing: where is this cipher stored? Can it happen that the icons inserted in this way will no longer be displayed? This is what worries me the most.
Answer the question
In order to leave comments, you need to log in
If you are talking about using the data:uri scheme, then the question here is not "correctness", but performance, and also why you are doing this at all.
Actually, the probability that this will not work is determined by a) data:uri support by the browser itself caniuse.com/#feat=datauri and b) SVG support caniuse.com/#feat=svg The
question "where is stored" is not clear . If you have already inserted the encoded image in CSS or HTML, then it is stored there.
Keep in mind that if you do not have any special requirements for how the pages work, it is better not to use this, because it only slows things down more.
Special requirements may include complete portability of the page (i.e. no external links, when absolutely everything, from HTML itself to scripts, styles and pictures, is stored in one file), some special conditions associated with HTTP requests ( exotic server settings that sends one request to one client, but over a wide channel, for example) and so on. Sometimes this can be used for some very small elements, when there is a risk that the server will give them last, and without them the whole display collapses.
I used these tricks at one time only to form forms that the user could save and watch offline. Some kind of PDF replacement.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question