$1.51

How can I add an image in the title bar using HTML?

Ask a question+
2

Hi everyone, I need your help, I need to know how I can add an image in the title bar using HTML. This is what I did to add the image, this is not working:

<DOCTYPE! HTML>
<html>
<head>
    <title>Homepage</title>
    <link rel="icon" href="favicon.ico" type="image/x-icon">
</head>
<body>
    ...some content
</body>
</html>
add comment

1 Answer

1

Here is what you can do. You can add favicons in two ways:

  • The image should be square dimensioned in any image format (ico, jpg, bmp, gif, png) to appear normally in browsers. Non-square images will also work; however, such icons may not look professional.
  • You should convert your image to .ico format. There are many online tools to do that.
  • Opening the tool, you should upload your image file. Then the image will be converted automatically.
  • Download your image and save your .ico file on your computer.
  • Rename the file to favicon.ico, because the browser will only recognize this name automatically.
  • Upload this file to the host directory where your website files are located.
  • When your favicon.ico file is uploaded the browser will select it automatically and show the image in the browser.

The second way to add favicons is the following:

  • The image should be square dimensioned in any image format (ico, jpg, bmp, gif, png)so as to appear normally in browsers. Non-square images will also work; however, such icons may not look professional.
  • Upload this file to the host directory where your website files are located.
  • The final step is to specify the image you would like to use as a favicon in the code of your website:

Add the following link to your <head> section:

<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">

Source: https://www.w3docs.com/snippets/html/how-to-add-an-image-in-the-title-bar.html. You can also try out some examples there.

David Ray 240
add comment

Your Answer