Forum Moderators: not2easy
<img src="data:image/png;base64,<BASE64 STRING>" />
as i want to keep the .html filesize as small as possible, i want to inline an image in css, so that i just have to write
<img class="someimage" />
<style type="text/css">
.someimage
{
background-image:url(data:image/png;base64,<BASE64 STRING>");
}</style>
but, as i am not an expert in css, my experiment failed.
anyone who could help me out on this one?
thanks in advance
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<style type="text/css" media="all">
div {
width:100px;
height:100px;
background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkAQMAAABKLAcXAAAABlBMVEX/AAAAAP9sof2OAAAAIUlEQVR4nGNgGAWjgFTw//8HJF4Dg8CI5aGGxCgYBcQBAMULD/2Zt2wmAAAAAElFTkSuQmCC);
}
</style>
</head>
<body>
<div>Hello world</div>
</body>
</html>