Data URI scheme allows us to include data in a webpage using inline-code, which can be used in Html, CSS, and Javascript.
Data URI scheme is often used to embed images into webpages. It is used as follows:
The data URI scheme format is as follows:
Data: [<MIME-type>] [; base64], <data>
The format is relatively simple. We can see that the above img is a jpg image encoded with base64.
Embed this img into this page, as shown below:
In addition to base64 encoding, you can also use hexadecimal URL encoding in the form of % xx, as shown below:
Generating image data
According to the above format, we can write a small program to generate, but we don't need to be so troublesome. Many websites provide this (free) service.
The following are some examples:
1. http://dataurl.sveinbjorn.org/dataurlmaker
Provides preview for convenient copying.
2. http://websemantics.co.uk/online_tools/image_to_data_uri_convertor/
Provides preview and generates the URI data of the corresponding CSS.
3. http://software.hixie.ch/utilities/cgi/data/data
Tip: generation is not limited to image data. You can use three methods (see steps 1, 2, and 3) to specify the encoding method, but the interface is unfriendly.
Used in group presentations
Click the insert/edit image button:
In the following window, use any of the above URLs to generate image data, copy and paste the data to the image address text box:
Click Insert. OK, for example:
View effects: http://space.cnblogs.com/group/topic/41938/
Data URI scheme allows us to include data in a webpage using inline-code, which can be used in Html, CSS, and Javascript.
Data URI scheme is often used to embed images into webpages. It is used as follows:
The data URI scheme format is as follows:
Data: [<MIME-type>] [; base64], <data>
The format is relatively simple. We can see that the above img is a jpg image encoded with base64.
Embed this img into this page, as shown below:
In addition to base64 encoding, you can also use hexadecimal URL encoding in the form of % xx, as shown below:
Generating image data
According to the above format, we can write a small program to generate, but we don't need to be so troublesome. Many websites provide this (free) service.
The following are some examples:
1. http://dataurl.sveinbjorn.org/dataurlmaker
Provides preview for convenient copying.
2. http://websemantics.co.uk/online_tools/image_to_data_uri_convertor/
Provides preview and generates the URI data of the corresponding CSS.
3. http://software.hixie.ch/utilities/cgi/data/data
Tip: generation is not limited to image data. You can use three methods (see steps 1, 2, and 3) to specify the encoding method, but the interface is unfriendly.
Used in group presentations
Click the insert/edit image button:
In the following window, use any of the above URLs to generate image data, copy and paste the data to the image address text box:
Click Insert. OK, for example:
View effects: http://space.cnblogs.com/group/topic/41938/