所以我有这个SVG文件,它有我想在WordPress网站上使用的动画。我尝试过很多种方法,但到目前为止似乎没有一种是可行的。
第一次尝试
<img class="icon" src="url of the image uploaded on worpress media" alt="icon">第二次尝试
<object class="icon" type="image/svg+xml" data="url of the image uploaded on worpress media"></object>第三次尝试
<object class="icon" type="image/svg+xml" data="url of the image uploaded on worpress media">
<img class="icon" src="url of the image uploaded on worpress media" alt="icon">
</object>第四次尝试
<img class="icon" src="<?php echo get_stylesheet_directory_uri(); ?>/assets/images/icon.svg" alt="icon">第五次尝试
Inline code of <svg></svg>. Then I moved the script part of the svg at the bottom of the file第六次尝试
Even tried to use <amination> tags and separate all data from the svg file..which was Painfull.PS:我在某个地方读到,上传一个移动的SVG是行不通的,特别是在像WordPress的媒体上传插件这样的媒体上传工具上,即使是在内联上也是如此。因此,我搜索一个网站,上传一个移动的SVG“将使它工作”...well..it没有。
PS2:是的,我也支持插件SVG
发布于 2022-07-19 20:54:05
所以解决方案在SVG文件中。在导出它的方式中,它有一个脚本,它没有运行。我用CSS属性导出它,使文件从300行变为20行。然后,我在CSS文件中添加了SVG中的动画,它非常完美。(使用SVG标签)
https://stackoverflow.com/questions/73002450
复制相似问题