Home > Programming > How to add or display favicon on a webpage?

How to add or display favicon on a webpage?

January 17th, 2009 Leave a comment Go to comments

What is favicon?

Favicon is shortcut of favorites icon, also known as website icon, shortcut icon, url icon, or bookmark icon.

On the graphical web browser, this icon locates on the Address bar and Tabs bar as seen in the screenshot below.

Screenshot of favicon

Screenshot of favicon

Add favicon

You required to have an image of 16×16 pixels, either PNG, ICO or GIF format

To display favicon to your webpage, add one of the following html code inside <head> depends on which image format you have.

<head>
<link rel=”icon” type=”image/x-icon” href=”path/myicon.ico”>
</head>

<head>
<link rel=”icon” type=”image/png” href=”path/myicon.png”>
</head>

<head>
<link rel=”icon” type=”image/gif” href=”path/myicon.gif”>
</head>

Categories: Programming
  1. No comments yet.
  1. No trackbacks yet.