<style>
.square{
background-color: Lightgreen;
width: 100px;
height: 100px;
}
.square:before{
display: block;
content: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' version='1.1' height='100' width='100'><circle cx='50' cy='50' r='40' stroke='black' stroke-width='3' fill='red' /></svg>");
background-size: 28px 28px;
height: 28px;
width: 28px;
}
</style>
<svg height="100" width="100">
<circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />
</svg>
<div class="square"></div>
.square:before{
display: block;
content: url("data:image/svg+xml;charset=UTF-8,$(svgcode)$");
background-size: 28px 28px;
height: 28px;
width: 28px;
}
\end