I'm trying to add and set favicon.ico.
When I saw a initial project that Visual Studio 2017 make automatically, the favicon.ico
file is just in the wwwroot
directory and there is no setting for it.
So, I add favicon file into wwwroot
directory.
But the favicon does not show up in any browsers.
How can I set the favicon in ASP.NET Core 2.0?
tag in your html or cshtml. For me, adding favicon. ico to wwwroot folder and pressing CTRL + F5 on my browser cleared the cache and made the new icon show up.
A favicon is the little image displayed at the left edge of the address bar in most browsers, or on the tab. A favicon is the little image displayed at the left edge of the address bar in most browsers, or on the tab. Adding a Favicon is a nice way to enhance your website and give it a finished look.
The standard size for favicons is 16x16 pixels, but most designers start with 32x32 pixels to accommodate retina screens. This way, the larger favicons show up nicely on retina screens and can also be scaled down.
wwwroot/index.html file has the link to favicon.
<link rel="icon" type="image/x-icon" href="favicon.ico">
is the code to add favicon to the website.
For .net core Single Page Application (SPA) project the favicon will be rendered from its own respective static file. For example if are using angular as client application there is index.html
file inside src
and in index.html
you can link your favicon with following code
<link rel="icon" type="image/x-icon" href="favicon.ico">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With