Next: Html

Pages

Showing posts with label Html. Show all posts
Showing posts with label Html. Show all posts

Embed an image into an HTML tag



In the normal way you use

<img src="…" alt="…" />

but some time you have to embed the image into HTML tag.

The format to use is the following:

data:[<MIME-type>][;charset="<encoding>"][;base64],<data>

and in my case (I wanto to embed a png image) I will have:

data:image/png;base64,<data>

Here the steps (how to convert img to data);

1) Open image with notepad++
2) Select all with CTRL+A
3) User plug-ing “MIME Tools | Base64 Encode” to convert the image selected.
4) move new data as below