是否可以favicon [GIF & ICO]通过 CSS 添加或者我需要在每个 HTML 页面中添加标签?
如何从 WordPress 主题中删除默认的图标链接?我知道我可以替换 favicon,但我正在寻找使用 remove_action 或类似的东西,我可以放置在我的 functions.php 中。谢谢。
<link rel='shortcut icon' href='img/favicon.ico'>
Run Code Online (Sandbox Code Playgroud)
以上行位于head页面的一部分内.
favicon.ico在img文件夹内.在Firefox和Chrome中不起作用.
我重新启动浏览器,多次清除缓存...
任何建议.
我也尝试过:
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
Run Code Online (Sandbox Code Playgroud) 我已经做了很多搜索和阅读来试图找到解决方案,但还没有想出或遇到任何对我有用的东西。我正在构建一个带有彩色主题结构的网站。我想让每个页面使用不同颜色的网站图标,因为它对应的页面颜色。例如:
我遇到的最接近的是使用 PHP 方法并在图标文件的末尾附加一个数字 -
<?php echo '<link rel="shortcut icon" href="http://www.yoursite.com/favicon.ico?t=' . time() . '" />; ?>
Run Code Online (Sandbox Code Playgroud)
除非 php 是错误的,否则这对我来说似乎不起作用。我不是 PHP 中最强的,但如果有人对此有任何建议或相关阅读,我们将不胜感激。
你好!
问题是,当 IIS 8.5 中的 http 重定向处于活动状态时,网站图标不会出现。我的操作系统是windows server 2012 r2,网络浏览器是IE11。
我做什么:我进入IIS 8.5,单击http重定向,选中第一个选项,输入http链接,然后应用。运行iisreset,清除IE现金,重新加载页面。favicon.ico 位于 wwwroot 文件夹中。
我尝试过的:
- 在 IIS 中添加 mime 类型(“.ico”=“image/x-icon”或“.ico”=“image/vnd.microsoft.icon”)
- 在页面中添加链接(link rel="icon" type="image/x-icon" href="/favicon.ico")
- 网站生成的不同图标。
请帮我!
谢谢
**[EDIT]**
This is how redirect is set in IIS:
--------------------------------
HTTP Redirect
Use the feature to specify rules for redirecting incoming requests to antoher file or URL.
V Redirect requests to this destination :
http://[dnsname]/[folder]/
Redirect Behavior
V Redirect all requests to exact destination (instead of relative to destination) …Run Code Online (Sandbox Code Playgroud) 我正在构建一个通过 https 提供服务的网络应用程序。我收到了很多这样的控制台警告:
Mixed Content: The page at 'https://www.sharewalks.com/' was loaded over
HTTPS, but requested an insecure image
'http://yandex.st/lego/_/pDu9OWAQKB0s2J9IojKpiS_Eho.ico?1493850556643'.
This content should also be served over HTTPS.
Run Code Online (Sandbox Code Playgroud)
其中有 14 个 - 来自以下网址(数字更改):
网站图标错误:
其他?:
我需要使用 HTTPS 提供所有内容,因为我想使用地理定位服务,并且我读到某些浏览器不允许它,除非所有内容都是 HTTPS。在测试中,导航器适用于笔记本电脑 Chrome,但不适用于移动浏览器(chrome、safari 和 firefox)。
但我不是要求这些网站图标。我什至不知道他们从哪里被叫到。
我的问题是这些 favicon 是什么,它们为什么要惹我?有没有办法解决?
我想在用户浏览其他浏览器选项卡时通知新收到的消息。
首先,我必须将闪烁的红色机器人设置为图标(这里的问题是 Google Chrome 不支持 GIF 动画作为图标)
$('#favicon').attr('href','_/css/img/favicon.gif');
Run Code Online (Sandbox Code Playgroud)
有没有办法循环播放两个图像,一个红色,一个白色,每个图像 500 毫秒?
setInterval(function() {
$('#favicon').attr('href','_/css/img/red.png');
}, 500);
Run Code Online (Sandbox Code Playgroud)
如何为两个图标执行 500 毫秒的循环?
我在realfavicongenerator.net上生成了收藏夹图标,但在 iPhone 6S 上的 Safari 中没有显示收藏夹图标。我清除了历史记录和网站数据,但没有帮助。这是我的 HTML 代码:
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="apple-touch-icon-precomposed" sizes="180x180" href="/apple-touch-icon-precomposed.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="194x194" href="/favicon-194x194.png">
<link rel="icon" type="image/png" sizes="192x192" href="/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/mstile-144x144.png">
<meta name="theme-color" content="#ffffff">
<link rel="icon" type="image/x-icon" href='/favicon.ico' />
<link rel="shortcut icon" type="image/x-icon" href='/favicon.ico' />
Run Code Online (Sandbox Code Playgroud)
如您所见,我添加了rel="icon"和rel"shortcut icon"以及预先组合的favicon,但没有任何帮助。我已经在互联网上查看并找不到解决方案。还有什么我可以做的吗?
我试图将一个favicon添加到Next.js静态站点,但运气不佳。
我尝试使用https://nextjs.org/docs/#custom-document中的组件自定义文档'next/document'
直接链接到favicon.ico文件不起作用,因为该文件未包含在构建中,并且href不会更新为 /_next/static/...
导入图像并添加到链接的href也不起作用(请参见注释掉的行)。
import React from 'react';
import Document, { Html, Head, Main, NextScript } from 'next/document';
// import favicon from '../data/imageExports';
export default class MyDocument extends Document {
static async getInitialProps(ctx) {
const initialProps = await Document.getInitialProps(ctx);
return { ...initialProps };
}
render() {
return (
<Html>
<Head>
{/* <link rel="shortcut icon" href={favicon} /> */}
<link rel="shortcut icon" href="../images/icons/favicon.ico" />
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
);
}
}
Run Code Online (Sandbox Code Playgroud)
网站链接已添加,但未显示。我希望它在导入文件时能正常工作,但是它只是添加了一个<link …
我想在 Vaadin 中更改与 Springboot 结合的网站的 favicon。我还选择在 Vaadin 中采用纯 Java 路线(无 html 页面)。
我遵循了这个指南,它解释了我希望使用的图标应该添加到src/main/webapp/icons文件夹中,在那里它会被自动拾取、调整大小等。
我试过无济于事,之后我发现这个线程,然后这一个。后一个链接特别说明了 Spring-boot 有自己的目录,webapp应该避免使用该文件夹。我尝试使用 spring 目录,但再次无济于事。
我的资源文件夹目前看起来是这样的:
我的 MainView 是这样的:
@Route
@PageTitle("My new title")
public class MainView extends VerticalLayout {
Run Code Online (Sandbox Code Playgroud)
我的SpringBootApplication班级是这样的:
@SpringBootApplication
public class MyVaadinApplication extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(MyVaadinApplication.class, args);
}
}
Run Code Online (Sandbox Code Playgroud)
图标仍然是默认的弹簧叶:
尝试设置网站图标时我哪里出错了?
favicon ×10
html ×4
css ×2
javascript ×2
php ×2
geolocation ×1
https ×1
icons ×1
iis ×1
iphone ×1
java ×1
jquery ×1
next.js ×1
spring-boot ×1
static-site ×1
vaadin ×1
wordpress ×1