Html 如何在地址栏上显示标志?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18458697/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 12:39:51  来源:igfitidea点击:

How to display the logo on the address bar?

htmlfavicon

提问by user2632980

I want to show logo on the address bar. But it is visible only on tab next to title.

我想在地址栏上显示徽标。但它仅在标题旁边的选项卡上可见。

<link rel="icon" href="http://www.mydomain.info/favicon.ico" type="image/x-icon" />      
<link rel="shortcut icon" href="http://www.mydomain.info/favicon.ico" type="image/x-icon" /> 

采纳答案by Bart Friederichs

Short answer: yes. That's how many browsers work.

简短的回答:是的。这就是许多浏览器的工作原理。

Firefox: http://msujaws.wordpress.com/2012/04/23/an-update-to-site-identity-in-desktop-firefox/

火狐:http: //msujaws.wordpress.com/2012/04/23/an-update-to-site-identity-in-desktop-firefox/

Chrome: why doesn't the favicon file show in the address bar of google chrome?and http://productforums.google.com/forum/#!topic/chrome/kUQOKVUwUmw

Chrome:为什么 favicon 文件没有显示在 google chrome 的地址栏中?http://productforums.google.com/forum/#!topic/chrome/kUQOKVUwUmw

In the wikipedia page, you can find some more about browser support. In short, Firefox and Chrome don't do it, Explorer, Safari and Opera do.

维基百科页面 中,您可以找到更多关于浏览器支持的信息。简而言之,Firefox 和 Chrome 不会这样做,Explorer、Safari 和 Opera 会这样做。

回答by Erno

It is up to the browser to decide where/whether to display a favicon.

由浏览器决定在何处/是否显示网站图标。

Chrome reserved the addressbar for the address and an indication of the protocol.

Chrome 为地址和协议指示保留了地址栏。

There is not much you can do about it.

您对此无能为力。