G
G
GunAlv2021-03-24 10:39:02
css
GunAlv, 2021-03-24 10:39:02

Which is smarter in terms of resources: inline or svg background?

For example, there is a non-bold regular icon that does not need to change color, etc. - just display once (not in a sprite). In this case, is it better to inline the svg or use it as a background image? And why?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Abdullaev, 2021-03-24
@avi_sdk

You don't need to inline SVG just like that. If you are not going to do any manipulations with its internals through JS, then insert it with an img tag or background-image style. Thus, you will not clog the markup once again.
There are more ways to insert through iframe and object. I advise you to study the difference, as it may come in handy in the future when working.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question