Friday, December 20, 2024
HomeComputer programmingWeb application programmingHTML: adding a website address bar icon or favicon

HTML: adding a website address bar icon or favicon

Place an icon beside your address line, and make your website more professional.


It is a very simple process.
*You probably noticed the little chef’s hat on this website, this is not exactly how www.tech-recipes.com did there’s as this site includes xml for hiding such features, but this will get you started with the same results.

Create Your Icon:
First you are going to need an image:
-using your favorite photo editing program resize it to 16×16 and save it as a .bmp file.

-next open it with paint or some other basic editing software that will not try to add anything to the file as photoshop and some other high end programs do, in the transfer from .jpg and .gif to .bmp and resave it, replaceing the old .bmp file.

-now that you have a proper likely 24-bit .bmp save the file -again with paint- only save it as the following:
favicon.ico
*This name is important as it identifies it as a favorite and makes the icon appear.
*Also some browsers will automatically look for this icon to display.

-If at all possible place this icon in the root of your website (eg. the same folder as your index.html file.

Apply the Icon to Your Page:
-Between the and tags, place the following code:
<link rel="shortcut icon" href="?\favicon.ico">

*Where the ? is the address or location of your icon

In the case of your index.html file being in the same folder as your icon, the code should look similar to this:
CODE Example:
<html>
<head>
<link rel="shortcut icon" href=".\favicon.ico">
</head>
<body>
</body>
</html>

*The “.” is a reference indicating to start the path from the current folder (eg. the folder in which the .html file is located)

*A different icon can be applied to every page, or the same icon to every page.

*NOTE in IE I have noticed that it can take a few days or even weeks before the icons start to show up, if they ever do (I’m not anti-MS, but i’m not a diehard fan either), and the same glitch occurs in some versions of Mozilla as well, but Firefox users will be able to see the icons immediately.

Questions/Comments: [email protected]
-William. § (marvin_gohan)

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

LATEST REVIEWS

Recent Comments

error: Content is protected !!