HTML Title Image

半腔热情 提交于 2019-11-27 12:33:51

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

<head>
    <title>My Site</title>
    <link rel="shortcut icon" href="favicon.ico" />
</head>

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.

Zuul

For cross browser compatibility, seems to be needed two lines for for favicon:

TITLE

<title>PAGE TITLE HERE</title>

FAVICON

<link rel="SHORTCUT ICON" href="http://domain and path/favicon.ico" />
<link rel="icon" href="http://domain and path/favicon.ico" type="image/ico" />

FAVICON GENERATOR:

DYNAMIC DRIVE

Please add a line similar to this within the head-elements:

<link rel="shortcut icon" href="/somwhere/icon.ico">

.ico files work best among old browser, but of course you can use png and jpeg files, too.

You are wanting to set a favicon. Here is the tag to do that:

<link rel="SHORTCUT ICON" href="favicon.ico" />

Add this tag to your <head /> and it will instruct browsers of the site to download the image referenced in the href.

How to Add a Favicon to your Site (W3C):
http://www.w3.org/2005/10/howto-favicon

and you can make any image a favicon with online generators like these:
http://tools.dynamicdrive.com/favicon/

You can also use a png image and make it a minimum of 310x310px to support all known devices. A modern browser will automatically size it accordingly.

i just found the icon i wanted online, right click and select "copy image URL"

<head>
<title>(title)</title>
<link rel="shortcut icon" href="(image URL)"/>
<head>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!