Blog [how to play] how to modify the blog's address bar logo- how to find and make ico file

Preface:

When we open our own blog, when such use Google browser to open:

Blog icons displayed as a default icon Park

So how do custom logo changed? ? ? How to modify the address bar logo blog it? ? ?

1. First of all have to prepare a file type icon

Method One: We can make up a little icon online

Open this website: Online ico icon to make and upload your own images (jpg, png), you can download a icon the icon.

As shown below:

Method Two: Download a icon Online icon

Open this website, DOWNLOAD, ICON (PNG / ICO / ICNS ) Download icon search , search for the desired icon, and then download icon.

 

 

 

 2. Upload your own icon ICON

Enter your own blog Manage -> File -> Select File -> Upload, and then click the file has been uploaded, the network address of the copy of the file, the network address will be used in the third step.

3. Add the script file

Enter your own blog Garden -> Settings, add the following JavaScript code to the "footer Html Code"

<script type="text/javascript" language="javascript"> 
  //Setting ico for cnblogs
  var linkObject = document.createElement('link');
  linkObject.rel = "shortcut icon";
  linkObject.href = "icon的网络路径";
  document.getElementsByTagName("head")[0].appendChild(linkObject);
</script>

将上面icon的网络路径替换为自己的上传的icon的网络地址。

保存设置后,刷新页面,就会看到地址栏的图标变了:

小伙伴们,新技能get了吗?赶快去试下吧!顺手点个赞哦!点我推荐

还有一件事,直接在页首HTML代码中添加下面这段代码不能成功

<link rel="shortcut icon" href="icon网络地址" />

所以我用了之前的JavaScript,这段JavaScript脚本我是查看头头哥博客的网页源代码copy过来的,在这感谢头头哥。

Guess you like

Origin www.cnblogs.com/guoxinyu/p/how-to-play-blog2.html