#mydiv::before { content: url("data:image/svg+xml; utf8, <svg ... code here</svg>"); display: block; width: 22px; height: 10px; margin: 10px 5px 0 10px; } And use this website for encode the svg: https://yoksel.github.io/url-encoder/