大网数据广告活动
网站运营与故障问答

Is it a good practice to use an SVG as a logo?

· 52CE 我爱测

I am building a website for a brand. The designer sent me the company logo in an .svg format. I rarely see SVG logos on websites, and I usually work with PNG images so I have two questions : Is it a good practice to use an .svg f…

问题原文

原帖链接 · Lulucmy · CC BY-SA 4.0

I am building a website for a brand. The designer sent me the company logo in an .svg format. I rarely see SVG logos on websites, and I usually work with PNG images so I have two questions :

  • Is it a good practice to use an .svg file as a site logo? Does it affect the SEO?
  • How do I embed it on the website? I've seen many practices :

<img src="logo.svg" alt="XYZ" height="87px" width="100px"/>

<svg id="logo" height="60" width="60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" > <image x="0" y="0" height="600" width="600" xlink:href="logo.svg" /></svg>

<svg xmlns="http://www.w3.org/2000/svg" width="280" height="53"><g fill="none" fill-rule="evenodd"><path d="..."fill="#FFF"/></svg>

Thank you for your help!

已采纳解答

原帖链接 · davidgo · CC BY-SA 4.0

Have a look at https://caniuse.com/?search=svg to see support. Id suggest to you that svg files are coming of age and widely supported, but not yet widely used in web pages.

It is good though that a designer provides you the svg of your logo. SVG files are vectors, which means they can scale infinitely without loss.

Were it me, as a conservative person I'd likely render the svg file as a png and use that. It might be worth doing a size comparison on the svg and a png and deciding if trail blazing even buys you anything.

I believe Google can read svg files.

With respect of embedding it - https://vecta.io/blog/best-way-to-embed-svg would seem a useful read. The tldr is use an <img> tag to embed it if you are going to use one. Be careful of referencing fonts in the svg

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2021-03-27)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。