我有一个 Angular 4 应用程序,我正在尝试将 SVG 文件导入到图像标签内的 html 文件中
i.e
<img src="../app/scalableVectorGraphics/landingpage/twitter.svg">
html 文件的路径:
suitsandtables/frontend/suitsandtables-app/src/app/browsevenues/venuelist/venuelist.component.html
svg 文件的路径:
/app/scalableVectorGraphics/landingpage/twitter.svg
我努力了
/app/scalableVectorGraphics/landingpage/twitter.svg
./app/scalableVectorGraphics/landingpage/twitter.svg
../app/scalableVectorGraphics/landingpage/twitter.svg
将 SVG 文件导入为图像时是否缺少某些内容?这似乎很简单。
将图像放入 src/assets/scalableVectorGraphics/... 中,然后:
HTML
<img src="assets/scalableVectorGraphics/landingpage/twitter.svg">
如果您需要放入样式表作为背景图片:
CSS:
background-image: url(/assets/scalableVectorGraphics/landingpage/twitter.svg)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)