favicon & css

Discussion in 'HTML' started by Paul Goodwin, Aug 7, 2005.

  1. Paul Goodwin

    Paul Goodwin Guest

    I have a client who wishes one of these 'favicons' on every page of a fairly
    large site, what I'm wondering, in order to save time, is if it's possible
    to add the icon via the external stylesheet, instead of laboriously adding
    it to each page.

    Thank you :)

    Paul
     
    Paul Goodwin, Aug 7, 2005
    #1
    1. Advertising

  2. Paul Goodwin wrote:
    > I have a client who wishes one of these 'favicons' on every page of
    > a fairly large site, what I'm wondering, in order to save time, is
    > if it's possible to add the icon via the external stylesheet,
    > instead of laboriously adding it to each page.


    No way that I know of to use CSS for a favicon. You would have to add
    the following in the <head> section of the pages. Use correct path, of
    course:

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

    It must also be a 16x16 true icon file.

    This would be easy if the stuff in the <head> were added to each page
    by a script, as I do; one file for the whole site.

    Internet Explorer users will not see it unless they bookmark the site,
    and then only until the cache is cleared.

    --
    -bts
    -This space intentionally left blank.
     
    Beauregard T. Shagnasty, Aug 7, 2005
    #2
    1. Advertising

  3. "Beauregard T. Shagnasty" <> wrote in message
    news:TYpJe.5615$...
    > Paul Goodwin wrote:
    >> I have a client who wishes one of these 'favicons' on every page of
    >> a fairly large site, what I'm wondering, in order to save time, is
    >> if it's possible to add the icon via the external stylesheet,
    >> instead of laboriously adding it to each page.

    >
    > No way that I know of to use CSS for a favicon. You would have to add the
    > following in the <head> section of the pages. Use correct path, of course:
    >
    > <link rel="shortcut icon" href="path/favicon.ico" type="image/x-icon">
    > <link rel="icon" href="path/favicon.ico" type="image/x-icon">
    >
    > It must also be a 16x16 true icon file.
    >
    > This would be easy if the stuff in the <head> were added to each page by a
    > script, as I do; one file for the whole site.
    >
    > Internet Explorer users will not see it unless they bookmark the site, and
    > then only until the cache is cleared.


    Yes. I was going to suggest putting the whole top area of the page
    (generally meta, logo headers, menu) in an include - either ssi or php. You
    could include the favicon bit in that.

    --Tina
    --
    http://www.AxisHOST.com - Serving the web since 1997
    Very Generous Cpanel Hosting & Fully Managed Servers
    Newsgroup 20% Discount Code: newsgroup
     
    Tina - AxisHOST, Inc., Aug 7, 2005
    #3
  4. Paul Goodwin wrote:

    > I have a client who wishes one of these 'favicons' on every page of a
    > fairly large site, what I'm wondering, in order to save time, is if it's
    > possible to add the icon via the external stylesheet, instead of
    > laboriously adding it to each page.


    It's sufficient to place the icon as 'favicon.ico' in the root folder of the
    site. That's the location a browser will look for (*), when it tries to
    load the favicon (look at your server logs and you'll see a lot of 404
    error for '/favicon.ico', because it is not present yet).

    (*) unless a different location is specified using <link rel="shortcut
    icon" ...>, but that you require a change of every page - something you
    don't want to do.

    --
    Benjamin Niemann
    Email: pink at odahoda dot de
    WWW: http://www.odahoda.de/
     
    Benjamin Niemann, Aug 7, 2005
    #4
  5. Paul Goodwin

    Paul Goodwin Guest

    "Tina - AxisHOST, Inc." <> wrote in message
    news:...
    >
    > "Beauregard T. Shagnasty" <> wrote in message
    > news:TYpJe.5615$...
    > > Paul Goodwin wrote:
    > >> I have a client who wishes one of these 'favicons' on every page of
    > >> a fairly large site, what I'm wondering, in order to save time, is
    > >> if it's possible to add the icon via the external stylesheet,
    > >> instead of laboriously adding it to each page.

    > >
    > > No way that I know of to use CSS for a favicon. You would have to add

    the
    > > following in the <head> section of the pages. Use correct path, of

    course:
    > >
    > > <link rel="shortcut icon" href="path/favicon.ico" type="image/x-icon">
    > > <link rel="icon" href="path/favicon.ico" type="image/x-icon">
    > >
    > > It must also be a 16x16 true icon file.
    > >
    > > This would be easy if the stuff in the <head> were added to each page by

    a
    > > script, as I do; one file for the whole site.
    > >
    > > Internet Explorer users will not see it unless they bookmark the site,

    and
    > > then only until the cache is cleared.

    >
    > Yes. I was going to suggest putting the whole top area of the page
    > (generally meta, logo headers, menu) in an include - either ssi or php.

    You
    > could include the favicon bit in that.


    That might be what I'm looking for, thanks for all the replies :)


    --
    Paul
     
    Paul Goodwin, Aug 7, 2005
    #5
  6. Benjamin Niemann wrote:
    > Paul Goodwin wrote:
    >
    >>I have a client who wishes one of these 'favicons' on every page of a
    >>fairly large site, what I'm wondering, in order to save time, is if it's
    >>possible to add the icon via the external stylesheet, instead of
    >>laboriously adding it to each page.

    >
    > It's sufficient to place the icon as 'favicon.ico' in the root folder of the
    > site. That's the location a browser will look for (*), when it tries to
    > load the favicon (look at your server logs and you'll see a lot of 404
    > error for '/favicon.ico', because it is not present yet).
    >
    > (*) unless a different location is specified using <link rel="shortcut
    > icon" ...>, but that you require a change of every page - something you
    > don't want to do.

    Can this also be done with .htaccess?
    --
    Edwin van der Vaart
    http://www.semi-conductor.nl/ Links to Semiconductors sites
    http://www.evandervaart.nl/ Under construction
     
    Edwin van der Vaart, Aug 7, 2005
    #6
  7. Edwin van der Vaart wrote:

    > Benjamin Niemann wrote:
    >> Paul Goodwin wrote:
    >>
    >>>I have a client who wishes one of these 'favicons' on every page of a
    >>>fairly large site, what I'm wondering, in order to save time, is if it's
    >>>possible to add the icon via the external stylesheet, instead of
    >>>laboriously adding it to each page.

    >>
    >> It's sufficient to place the icon as 'favicon.ico' in the root folder of
    >> the site. That's the location a browser will look for (*), when it tries
    >> to load the favicon (look at your server logs and you'll see a lot of 404
    >> error for '/favicon.ico', because it is not present yet).
    >>
    >> (*) unless a different location is specified using <link rel="shortcut
    >> icon" ...>, but that you require a change of every page - something you
    >> don't want to do.

    > Can this also be done with .htaccess?


    Not directly. You may use mod_rewrite to serve a different file for requests
    to '/favicon.ico'. But this .htaccess file must be placed in the root
    folder in order to be effective - so there's nothing gained.

    --
    Benjamin Niemann
    Email: pink at odahoda dot de
    WWW: http://www.odahoda.de/
     
    Benjamin Niemann, Aug 8, 2005
    #7
  8. Benjamin Niemann wrote:
    > Edwin van der Vaart wrote:
    >>Benjamin Niemann wrote:
    >>>Paul Goodwin wrote:
    >>>
    >>>>I have a client who wishes one of these 'favicons' on every page of a
    >>>>fairly large site, what I'm wondering, in order to save time, is if it's
    >>>>possible to add the icon via the external stylesheet, instead of
    >>>>laboriously adding it to each page.
    >>>
    >>>It's sufficient to place the icon as 'favicon.ico' in the root folder of
    >>>the site. That's the location a browser will look for (*), when it tries
    >>>to load the favicon (look at your server logs and you'll see a lot of 404
    >>>error for '/favicon.ico', because it is not present yet).
    >>>
    >>>(*) unless a different location is specified using <link rel="shortcut
    >>>icon" ...>, but that you require a change of every page - something you
    >>>don't want to do.

    >>
    >>Can this also be done with .htaccess?

    >
    > Not directly. You may use mod_rewrite to serve a different file for requests
    > to '/favicon.ico'. But this .htaccess file must be placed in the root
    > folder in order to be effective - so there's nothing gained.

    Thanx for the information.
    --
    Edwin van der Vaart
    http://www.semi-conductor.nl/ Links to Semiconductors sites
    http://www.evandervaart.nl/ Under construction
     
    Edwin van der Vaart, Aug 8, 2005
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer

    favicon.ico and long pathnames

    Kevin Spencer, Jan 20, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    432
  2. Martin Maat
    Replies:
    0
    Views:
    930
    Martin Maat
    May 30, 2004
  3. Patrick Olurotimi Ige

    Having favicon.ico instead of IE.ico on a website

    Patrick Olurotimi Ige, Dec 9, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    3,538
    Martin Dechev
    Dec 9, 2004
  4. Mika Stenberg

    Problem with Favicon

    Mika Stenberg, Oct 23, 2003, in forum: HTML
    Replies:
    6
    Views:
    602
    Mark Parnell
    Oct 24, 2003
  5. Samuël van Laere

    Favicon colors?

    Samuël van Laere, Nov 3, 2003, in forum: HTML
    Replies:
    3
    Views:
    2,518
    tjramos
    Sep 10, 2011
Loading...

Share This Page