skip to Main Content

Can anyone advise me on how to add an icon to the head of my HTML code? I have an image on Github that I need to use, but I just don’t know how to get the href to the image. Can anyone explain, please? Sorry, I know this is basic.

I’m using this code:

<link rel="icon" href="" type="" >

2

Answers


  1. Try this:

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

    There is description how to use it: https://www.w3schools.com/html/html_favicon.asp

    Login or Signup to reply.
  2. To add an icon to the head of your HTML code, you need to use the tag with the rel attribute set to "icon" and the href attribute set to the URL of your icon image. If your icon is hosted on GitHub, you can use the direct link to the image file in your GitHub repository.

    Try this:

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

    The actual URL of your image, you can get this URL by navigating to the image file in your GitHub repository, clicking on it, then right-clicking on the "Download" button and selecting "Copy link address".

    The type attribute should be set to "image/x-icon" if your icon is in .ico format. If it’s a .png or .jpg, use "image/png" or "image/jpeg" respectively.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search