Advertisement

Postingan

Menampilkan postingan dari Maret, 2020

Data URI

top computer
Data  URI A Data  URI  takes the format: data:[ < MIME-type > ][;charset= < encoding > ][;base64], < data > The  MIME-type  specifies what type of data the  URI  contains. So if you wanted to provide a data  URI  for an image you would specify it as follows: < img src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO 9TXL0Y4OHwAAAABJRU5ErkJggg==" alt = "Red dot" /> The  MIME  type used here is  image/png  indicating that the encoded data is a PNG image. Audio Similarily, if you wanted to encode an Ogg audio file, you would use the  MIME  type  audio/ogg  as follows: < audio controls src = "data:audio/ogg;base64,T2dnUwACAAAAAAAAAAA+..........+fm5nB6slBlZ3Fcha363d5ut7u3ni1rLoPf728l3KcK" /> If you want to specify an MP3 file you would simply set the  MIME  type to ...