HTML 标题图像
我想在 HTML 页面的标题上有一个图像(即与标题一起在选项卡上)。我怎样才能做到这一点?
I want to have an image on the title in an HTML page (i.e on the tab along with the title). How can I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您需要的是 favicon.ico 文件。
只需将其放在网站的根目录中,并在页面标题中链接到它
即可。您应该将其放在网站的根目录中,并将其命名为 favicon.ico,因为即使您不链接到它,某些浏览器也会查找它在您的页面上。
What you need is a favicon.ico file.
Just put it in the root of your site and link to it in the header of your page
You should put it in the root of your site and name it favicon.ico because some browsers look for it even if you don't link to it on your pages.
为了跨浏览器兼容性,favicon 似乎需要两行:
TITLE
FAVICON
FAVICON GENERATOR:
动态驱动
For cross browser compatibility, seems to be needed two lines for for favicon:
TITLE
FAVICON
FAVICON GENERATOR:
DYNAMIC DRIVE
请在 head-elements 中添加与此类似的行:
.ico 文件在旧浏览器中效果最佳,但当然您也可以使用 png 和 jpeg 文件。
Please add a line similar to this within the head-elements:
.ico files work best among old browser, but of course you can use png and jpeg files, too.
您想要设置一个网站图标。下面是执行此操作的标记:
将此标记添加到您的
中,它将指示站点的浏览器下载 href 中引用的图像。
You are wanting to set a favicon. Here is the tag to do that:
Add this tag to your
<head />
and it will instruct browsers of the site to download the image referenced in the href.