Best way to add favicon png, gif, ico to your website

Web hosting, SEO, etc... related
Post Reply
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Best way to add favicon png, gif, ico to your website

Post by Neo » Thu Sep 16, 2010 1:30 am

The first approach for specifying a favicon is to use the rel attribute value "icon" and to define what the value means via a profile; profiles are discussed in more detail below. In this HTML 4.01 example, the favicon identified via the URI http://example.com/myicon.png as being a favicon:

Code: Select all

<!DOCTYPE html 
      PUBLIC "-//W3C//DTD HTML 4.01//EN"
      "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head profile="http://www.w3.org/2005/10/profile">
<link rel="icon" 
      type="image/png" 
      href="http://example.com/myicon.png"></link>
[…]
</head>
[…]
</html> 
The XHTML 1.0 version looks very similar:

Code: Select all

<!DOCTYPE html 
      PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html
      xmlns="http://www.w3.org/1999/xhtml" 
      xml:lang="en-US"
      lang="en-US">
<head profile="http://www.w3.org/2005/10/profile">
<link rel="icon" 
      type="image/png" 
      href="/somewhere/myicon.png" /></link>
[…]
</head>
[…]
</html> 
Post Reply

Return to “Web Related”