How to create a data URI

I recently stumbled upon a data URI scheme and read about it on Wikipedia .

An example code looks something like this:

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
          AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
          9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot">

My question is this: how do you create code (IE:) iVBORw0KGgoAAAA...for use on a website?

Note. I am specifically looking for how to do this without server-side scripts. But you can still host the server side script for others that may run into this issue. I also saw websites that do this for you, how can I do it myself?

+2
source share
4 answers

-, , . HTML, CSS . , . , , URI , - Google AVG. , , .

-1

Google Chrome:

  • URL- ( )
  • URL-
  • URI ,
+4

Wikipedia, URI - (, png) . , , base64 .

, -, - , MIME-. URI - ( !) , URI.

+1

( , .)

. , Firefox:

  • Firefox ( - ).
  • " ".
  • In the inspector, the image tag should now be highlighted. Right-click the image tag and select "Copy Image URL" (although this may not be the URL, this is what is currently being called up on the menu).
  • Insert the data URI where you need it.
0
source

All Articles