HTML Title Image

前端 未结 7 2084
梦毁少年i
梦毁少年i 2020-12-03 02:16

I want to have an image on the title in an HTML page (i.e on the tab along with the title). How can I do that?

相关标签:
7条回答
  • 2020-12-03 02:46

    You can also use a png image and make it a minimum of 310x310px to support all known devices. A modern browser will automatically size it accordingly.

    0 讨论(0)
  • 2020-12-03 02:47

    What you need is a favicon.ico file. Just put it in the root of your site and link to it in the header of your page

    <head>
        <title>My Site</title>
        <link rel="shortcut icon" href="favicon.ico" />
    </head>
    

    You should put it in the root of your site and name it favicon.ico because some browsers look for it even if you don't link to it on your pages.

    0 讨论(0)
  • 2020-12-03 02:54

    You are wanting to set a favicon. Here is the tag to do that:

    <link rel="SHORTCUT ICON" href="favicon.ico" />
    

    Add this tag to your <head /> and it will instruct browsers of the site to download the image referenced in the href.

    0 讨论(0)
  • 2020-12-03 03:01

    i just found the icon i wanted online, right click and select "copy image URL"

    <head>
    <title>(title)</title>
    <link rel="shortcut icon" href="(image URL)"/>
    <head>
    
    0 讨论(0)
  • 2020-12-03 03:07

    How to Add a Favicon to your Site (W3C):
    http://www.w3.org/2005/10/howto-favicon

    and you can make any image a favicon with online generators like these:
    http://tools.dynamicdrive.com/favicon/

    0 讨论(0)
  • 2020-12-03 03:12

    Please add a line similar to this within the head-elements:

    <link rel="shortcut icon" href="/somwhere/icon.ico">
    

    .ico files work best among old browser, but of course you can use png and jpeg files, too.

    0 讨论(0)
提交回复
热议问题