Languages
[Edit]
EN

HTML / SEO - attach png icons / favicons with different sizes to your webpage

4 points
Created by:
Kate_C
2895

In this short article we would like to show how to attach icon to your webpage.

It is good to use following sizes: 
48x48, 72x72, 96x96, 144x144, 192x192, 256x256, 384x384, 512x512.

Simple steps:

  1. export your icons to ico, gif or png files:
    batch export from svg to png with Inkscape you can find here,
  2. insert link elements with icon paths inside head element:
    it is good to use proper sizes of icons to match it with different devices,
// ONLINE-RUNNER:browser;

<!doctype html>
<html>
<head>
  <link rel="icon" sizes="48x48" type="image/png" href="/gfx/icon-48x48.png" />
  <link rel="icon" sizes="72x72" type="image/png" href="/gfx/icon-72x72.png" />
  <link rel="icon" sizes="96x96" type="image/png" href="/gfx/icon-96x96.png" />
  <link rel="icon" sizes="144x144" type="image/png" href="/gfx/icon-144x144.png" />
  <link rel="icon" sizes="192x192" type="image/png" href="/gfx/icon-192x192.png" />
  <link rel="icon" sizes="256x256" type="image/png" href="/gfx/icon-256x256.png" />
  <link rel="icon" sizes="384x384" type="image/png" href="/gfx/icon-384x384.png" />
  <link rel="icon" sizes="512x512" type="image/png" href="/gfx/icon-512x512.png" />
</head>
<body>
  Web page content here...
</body>
</html>

 

Hey 👋
Would you like to know what we do?
  • Dirask is a friendly IT community for learners, professionals and hobbyists to share their knowledge and help each other in extraordinary easy way.
  • We welcome everyone,
    no matter what the experience,
    no matter how basic the question is,
    this community will help you.