How to add icon logo in title bar in html

You might have seen that website have a small icon logo on their title bar that logo called Favicon and it is a small icon file, This may be a logo file as well.so let me show you how does it look.

So as you can see on above image there is an icon on title bar and now following is the example to show this image icon on title bar.


<!DOCTYPE html>
  <title>Example of Favicon</title>
  <link rel="icon" type="image/x-icon" href="favicon.ico">

<h1>This is Example</h1>


In the example the <link>  tag is used to make relation with icon of logo/image, In type attribute we need to tell the media type and href has the location of file of icon.ICO format is used to display icon usually but you cam use any format such as PNG, JPG, GIF etc.

Leave a Comment