Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Favicon

Reply
Thread Tools

Favicon

 
 
shapper
Guest
Posts: n/a
 
      11-23-2008
Hello,

I am adding a Favicon as follows:
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />

I supose this is correct. Do I need to place the favicon on the site's
root or can I place it on a images folder and change the href.? For
example:

<link rel="shortcut icon" href="images/favicon.ico" type="image/x-
icon" />

Thanks,
Miguel
 
Reply With Quote
 
 
 
 
Raymond SCHMIT
Guest
Posts: n/a
 
      11-23-2008
On Sat, 22 Nov 2008 18:30:16 -0800 (PST), shapper <(E-Mail Removed)>
wrote:

>Hello,
>
>I am adding a Favicon as follows:
><link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
>
>I supose this is correct. Do I need to place the favicon on the site's
>root or can I place it on a images folder and change the href.? For
>example:
>
><link rel="shortcut icon" href="images/favicon.ico" type="image/x-
>icon" />
>

The favicon href is related with root of the page we surf, not
necessary the root of the site.
Per example you may have index.html on the root of the site and the
differents pages on pages/welcome.htm.

if you put favicon there -> pages/images/favicon.ico
your href of the welcome.htm page will be = href="images/favicon.ico"

if you put favicon there -> pages/favicon.ico
your href of the welcome.htm page will be = href="favicon.ico"

if you put favicon there -> favicon.ico
your href of the welcome.htm page will be = href="../favicon.ico"

if you put favicon there -> images/favicon.ico
your href of the welcome.htm page will be =
href="../images/favicon.ico"

Someone may correct me if i have said something wrong.
This are simple example without speaking about the "base" - all infos
can be found there -> http://www.w3schools.com/TAGS/tag_base.asp
 
Reply With Quote
 
 
 
 
Roy A.
Guest
Posts: n/a
 
      11-24-2008
On 23 Nov, 10:39, (E-Mail Removed) (Raymond SCHMIT) wrote:
> On Sat, 22 Nov 2008 18:30:16 -0800 (PST), shapper <(E-Mail Removed)>
> wrote:
>
> >Hello,

>
> >I am adding a Favicon as follows:
> ><link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />

>
> >I supose this is correct. Do I need to place the favicon on the site's
> >root or can I place it on a images folder and change the href.? For
> >example:

>
> ><link rel="shortcut icon" href="images/favicon.ico" type="image/x-
> >icon" />

>
> The favicon href is related with root of the page we surf, not
> necessary the root of the site.


Yes, correct. But you can also use an 'absolute-path reference' by
adding an slash before the url:

href="/favicon.ico"

whould refer to favicon.ico file in the site root, e.g. 'example.com/
favicon.ico'

href="/images/favicon.ico"

would refere to the facicon.ico file in the images folder directly
under the site root, e.g. 'example.com/images/favicon.ico'

I.e. insted of 'href="http://www.example.com/images/favicon.ico' you
could use 'href="/images/favicon.ico"'.

"A relative reference that begins with a single slash character is
termed an absolute-path reference."
http://tools.ietf.org/html/rfc3986#section-4.2

> Per example you may have index.html on the root of the site and the
> differents pages on pages/welcome.htm.
>
> if you put favicon there -> pages/images/favicon.ico
> your href of the welcome.htm page will be = href="images/favicon.ico"
>
> if you put favicon there -> pages/favicon.ico
> your href of the welcome.htm page will be = href="favicon.ico"
>
> if you put favicon there -> favicon.ico
> your href of the welcome.htm page will be = href="../favicon.ico"
>
> if you put favicon there -> images/favicon.ico
> your href of the welcome.htm page will be =
> href="../images/favicon.ico"
>
> Someone may correct me if i have said something wrong.


That would be right, but I find it easyer to use a path relative to
the site root. Although, you would have to set up an web server to
make this work at your localhost.

> This are simple example without speaking about the "base" - all infos
> can be found there ->http://www.w3schools.com/TAGS/tag_base.asp


I wouldn't mess too much around with the base tag. It will give you
more trouble than it solves.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to remove a favicon from ONE site only? arun21@gmail.com Firefox 2 11-10-2005 07:15 AM
He;lp! Got the wrong favicon in the bookmarks! pyotr filipivich Firefox 3 03-24-2005 05:57 PM
Having favicon.ico instead of IE.ico on a website Patrick Olurotimi Ige ASP .Net 1 12-09-2004 02:27 PM
Favicon for cloaked site in virtual directory Martin Maat ASP .Net 0 05-30-2004 03:01 PM
favicon.ico and long pathnames Kevin Spencer ASP .Net 2 01-21-2004 02:31 PM



Advertisments