HTML Title Image

HtmlFavicon

Html Problem Overview


I want to have an image on the title in an HTML page (i.e on the tab along with the title). How can I do that?

Html Solutions


Solution 1 - Html

What you need is a favicon.ico file. Just put it in the root of your site and link to it in the header of your page

<head>
    <title>My Site</title>
    <link rel="shortcut icon" href="favicon.ico" />
</head>

You should put it in the root of your site and name it favicon.ico because some browsers look for it even if you don't link to it on your pages.

Solution 2 - Html

For cross browser compatibility, seems to be needed two lines for for favicon:

TITLE

<title>PAGE TITLE HERE</title>

FAVICON

<link rel="SHORTCUT ICON" href="http://domain and path/favicon.ico" />
<link rel="icon" href="http://domain and path/favicon.ico" type="image/ico" />

FAVICON GENERATOR:

DYNAMIC DRIVE

Solution 3 - Html

Please add a line similar to this within the head-elements:

<link rel="shortcut icon" href="/somwhere/icon.ico">

.ico files work best among old browser, but of course you can use png and jpeg files, too.

Solution 4 - Html

You are wanting to set a favicon. Here is the tag to do that:

<link rel="SHORTCUT ICON" href="favicon.ico" />

Add this tag to your <head /> and it will instruct browsers of the site to download the image referenced in the href.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJamesView Question on Stackoverflow
Solution 1 - HtmlEd BView Answer on Stackoverflow
Solution 2 - HtmlZuulView Answer on Stackoverflow
Solution 3 - HtmlHendrik BrummermannView Answer on Stackoverflow
Solution 4 - HtmlJD CourtoyView Answer on Stackoverflow