Php SVG-定位赢得';行不通
我是SVG新手。我认为有两种方法可以在wordpress模板中插入SVG图标 1.:使用“use”Php SVG-定位赢得';行不通,php,css,wordpress,svg,Php,Css,Wordpress,Svg,我是SVG新手。我认为有两种方法可以在wordpress模板中插入SVG图标 1.:使用“use” 我使用以下代码,允许您为旧浏览器定义回退。此方法允许您以与普通图像相同的方式应用CSS。由于SVG是基于矢量的,所以必须指定宽度和高度 <img src="<?php bloginfo('template_directory'); ?>/img/example.svg" onerror="this.onerror=null; this.src='<?php blogin
我使用以下代码,允许您为旧浏览器定义回退。此方法允许您以与普通图像相同的方式应用CSS。由于SVG是基于矢量的,所以必须指定宽度和高度
<img src="<?php bloginfo('template_directory'); ?>/img/example.svg" onerror="this.onerror=null; this.src='<?php bloginfo('template_directory'); ?>/img/example.png'" alt="" />
/img/example.svg“onerror=”this.onerror=null;this.src='/img/example.png'“alt=”“/>
我不能这样做,因为我使用的是CMS,客户应该能够为主题中的图标选择颜色。当我使用“img src”时,我不能使用“颜色:#…”或“fil:#…”这样做。