在浏览器标签页旁边的页面标题中的图像 - 如何在此处链接图像?
.ico
文件,这是标准的favicon文件类型。你也可以使用.png
或.gif
,但是为了更好的兼容性,你应该遵循标准。Make a square image of your logo (preferably 32x32 or 16x16 pixels, as far as I know there's no max size*), and transform it into an .ico
file. You can do this on Gimp, Photoshop (with help of a plugin) or a website like Favicon.cc or RealFaviconGenerator.
Then, you have two ways of setting it up:
A) Placing it on the root folder/directory of your website (next to index.html
)
with the name favicon.ico
.
or
B) Link to it between the <head></head>
tags of every .html
file on your site, like this:
<head>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
</head>
www.url.com/favicon.ico
即可(可能)看到。Stackoverflow 的 favicon 大小为 16x16 像素,Wikipedia 的大小为 32x32。它被称为'网站图标',您需要将以下代码添加到您的网站头部部分。
只需将此代码添加到<head>
部分即可。
<link rel="icon" href="/your_path_to_image/favicon.jpg">
这是网站图标并在链接中有解释。
例如来自W3C。
<link rel="icon"
type="image/png"
href="http://example.com/myicon.png">
当然,还需要将图像文件放置在正确的位置。
在您的网站根目录下添加名为“favicon.ico”的图标文件。
16x16
像素。 - uınbɐɥs<link rel="apple-touch-icon" sizes="114x114" href="${resource(dir: 'images', file:
'apple-touch-icon-retina.png')}">
<link rel="shortcut icon" sizes="114x114" href="${resource(dir: 'images', file: 'favicon.ico')}"
type="image/x-icon">
**<HEAD>**
< link rel="icon" href="directory/image.png">