R
R
riksisharakshas2018-11-04 09:55:22
css
riksisharakshas, 2018-11-04 09:55:22

How to insert svg directly into css?

They asked me to insert svg into the background not as a url, but as an svg object, so that it would be cached and I got stuck, I didn’t hear about such a possibility at all, less is used. I can't google, can you tell me something here?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AngReload, 2018-11-04
@riksisharakshas

yoksel.github.io/url-encoder/ru

M
Moskus, 2018-11-04
@Moskus

For example, like this:

.bg {
  background: url('data:image/svg+xml;utf8,<svg ...> ... </svg>');
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question