I use a program here in the company that in its Web module it has its logo inserted directly in CSS something like:
#logo img{
max-width:100%;
background-image: 'data|base64=acSs....';
}
How do I create this kind of background myself?
I use a program here in the company that in its Web module it has its logo inserted directly in CSS something like:
#logo img{
max-width:100%;
background-image: 'data|base64=acSs....';
}
How do I create this kind of background myself?
This construction is called data URI , it is a way of embedding data into a webpage as if it were external resources .
Follow the format:
data:<MIME-type>;charset=<encoding>;base64,<dados>
Example :
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==
In the example image/png
is the MIME-type; charset
was omitted; and finally base64
indicates that the content is encoded in (guess) base 64 .
If omitted the ;base64
is assumed encoding ASCII. If I am not mistaken these are the only encodings allowed.
Q.: