How to add image with title of an HTML page?

后端 未结 6 849
-上瘾入骨i
-上瘾入骨i 2020-12-29 15:53

How to add image or logo of a page with the title of that page which is displayed with the title in chrome, firefox or other browsers?

相关标签:
6条回答
  • 2020-12-29 16:19

    Taken from What is Favicon.ico and How to Create a Favicon Icon for Your Website

    How to Create a "Favicon.ico" File

    1.Create an image 16X16 pixels in size. Yes, it is really small and you can't really draw much in it. You should also restrict yourself to the standard Windows 16 colours, although I suspect that 256 colours will work fine.

    If you like, you can also create a 32X32 pixel icon, which will be scaled to size for the Favorites menu and the location bar. You can even put both 16X16 and 32X32 pixel icons into the same icon file. Windows will use the former for its menus and the latter when the user opens up a folder that is set to display large icons. It's probably not really necessary to do this if you can't be bothered.

    2.Save the image as an ICO file (named "favicon.ico", of course).

    3.Upload it to your website. You don't need to upload one to every directory of your site if you don't want to waste space - simply put it in your root directory and the web browsers that support favicons will apparently locate it eventually. You can also upload it into your images directory, but you will need to modify your web pages if you do. See later in this article for more information on this.

    Help! My Web Host Doesn't Allow ICO Files!

    If your hosting company does not allow files with the .ICO extension to be uploaded, you might try to work around it by uploading it (in binary mode) with some other extension (like GIF). Once it's on your site, rename it using your FTP program to the correct extension.

    <head>
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" /> 
    </head>
    
    0 讨论(0)
  • 2020-12-29 16:21
    <link rel="icon" href="image_name.ico" />
    <title>Place your html title here</title>
    

    Here link specify relation between current resource which is icon .href gives address of image to browser.Image can be of any type eg: jpg format

    0 讨论(0)
  • 2020-12-29 16:28

    What you are looking for is a favicon.

    The preferred way to add this, as guided by the W3 consortium, is to use a profile in your page <head> tags:

    <head profile="http://www.yoursite.com/profile">
    <link rel="icon" 
      type="image/png" 
      href="http://example.com/myicon.png">
    […]
    </head>
    

    See here for instructions for adding to your site.

    0 讨论(0)
  • 2020-12-29 16:31
    <head>
        <link rel="shortcut icon" href="title_icon.png">
    </head>
    
    0 讨论(0)
  • 2020-12-29 16:34

    Here is the code for Setting your favicon for your website. Your favicon will be display along with specified webpage title. Just use following codes.

    <!DOCTYPE html>
    <html>
        <head>
            <title> mytitle </title>
            <link rel="icon" href="http://i58.tinypic.com/302rtyg.png" type="image/png">
    
        </head>
    
    </html>
    
    0 讨论(0)
  • 2020-12-29 16:36

    Here is a really easy site I use to creat my favicons: favicon.cc

    Here are its advantages:

  • You can choose custom colors
  • Downloadable
  • Can be published and shared
  • Can resize picture to fit size(though might be distorted
  • If you are like me and have multiple favicons, you should just create a directory called "favicons" and then place the pictures inside.

    Remember to give each one unique name such as default.ico or blog.ico

    Remember to download your favicons.
    Here is how you access the favicons:

    <link href="/YOUR_PATH/favicon.ico" rel="icon" type="image/x-icon" />
    
0 讨论(0)
提交回复
热议问题