桌面图标每个上都带个空白页_创建带有数据的空白图标

桌面图标每个上都带个空白页

I was recently setting up a virtual host and diving into development when I needed to debug a JavaScript issue.  One thing that started annoying me right away was the console message notifying me that the favicon.ico file couldn't be found.  I hadn't put one there and had no desire to...but that damn message was bugging the hell out of me.  I did a quick search and found a tiny data URL snippet to include a blank favicon within the page.

最近,当我需要调试JavaScript问题时,我正在设置一个虚拟主机并开始开发。 立即使我烦恼的一件事是控制台消息,通知我找不到favicon.ico文件。 我没有把它放在那里,也不想……但是那该死的消息使我烦恼。 我进行了快速搜索,发现一个很小的数据URL片段在页面内包含一个空白的图标。

HTML (The HTML)

The empty favicon is created with the LINK element:

空的收藏夹图标是使用LINK元素创建的:


<link href="data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQEAYAAABPYyMiAAAABmJLR0T///8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAAF0lEQVRIx2NgGAWjYBSMglEwCkbBSAcACBAAAeaR9cIAAAAASUVORK5CYII=" rel="icon" type="image/x-icon" />


Essentially, instead of linking the external ico file, the image data is placed in the HREF attribute.  Cool, huh?  No more annoying messages and no need to add another file to the repository.

本质上,图像数据放置在HREF属性中,而不是链接外部ico文件。 酷吧? 不再有烦人的消息,也无需向存储库添加其他文件。

翻译自: https://davidwalsh.name/blank-favicon

桌面图标每个上都带个空白页

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值