[SVG] Add an SVG as a Background Image
Posted Answer1215
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[SVG] Add an SVG as a Background Image相关的知识,希望对你有一定的参考价值。
Learn how to set an SVG as the background image of an element. Background images can be resized by changing the width
and height
of the element containing background image, so it’s easy to create multiple sizes of the same icon.
However, each background image creates an HTTP request, so be aware of your page load speed. With this approach, you are unable to change attributes on the SVG such as fill or stroke.
If you want the ability to display icons at different sizes and don’t need to change their appearance or their interaction styles (such as on :hover
), this could be a good option for you.
以上是关于[SVG] Add an SVG as a Background Image的主要内容,如果未能解决你的问题,请参考以下文章
[HTML5] Add an SVG Image to a Webpage and Get a Reference to the Internal Elements in JavaScript(代码片