Jump to content

Adding a Favicon Problem


Gokhan

Recommended Posts

Hello all,

 

I try to add a favicon to an HTML page. It works when I use the code below:

<!DOCTYPE html><html><head><title>Example</title><link rel="icon" type="image/gif" href="http://www.w3schools.com/tags/demo_icon.gif"></head><body><p>An example paragraph.</p></body></html>

It uses the logo shown in the tutorial section. After that I downloaded that image and saved to the same folder as the HTML page I use. When I change the code to the below one it doesn't work:

<!DOCTYPE html><html><head><title>Example</title><link rel="icon" type="image/gif" href="demo_icon.gif"></head><body><p>An example paragraph.</p></body></html>

What is the problem here? When I refer to an adress on the web it works but when I refer a file in my hard drive it doesn't. I also try to use an .ico file generated online however it didn't work too. Could someone help me about my problem?

Edited by Gokhan
Link to comment
Share on other sites

  • 2 weeks later...

I just copy & pasted the code you provided, and it worked perfectly in Firefox, Opera, and Google Chrome. :)

Just remember to add a shortcut link:

<link rel="shortcut icon" href="PICTURE.png" type="image/png" sizes="16x16"/>
Edited by Professor GIBS
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...