[SVG] Add an SVG as an Embedded Background Image
Posted Answer1215
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[SVG] Add an SVG as an Embedded Background Image相关的知识,希望对你有一定的参考价值。
Learn how to set an elements background image to embedded SVG. This method has an added benefit of not incurring any HTTP requests, as the SVG is simply embedded into the CSS. They can also 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 using this approach.
If you’re looking for the ability to display icons at different sizes and want to modify the SVG interaction styles (such as on :hover
), this is could be a good option. One negative to adding the interaction styles is that it requires you to duplicate selectors and the SVG markup; the more icons you have, the larger your stylesheets will become.
Two Rules:
1. The embedded svg image, should use single quote.
2. Should encoder, can use http://meyerweb.com/eric/tools/dencoder/
以上是关于[SVG] Add an SVG as an Embedded Background Image的主要内容,如果未能解决你的问题,请参考以下文章
[HTML5] Add an SVG Image to a Webpage and Get a Reference to the Internal Elements in JavaScript(代码片
[SVG] Combine Multiple SVGs into an SVG Sprite
500px-An_example_of_theoretical_DNS_recursion_svg在浏览器地址栏输入地址,到浏览器显示页面的过程