A favicon is the small icon shown in the browser tab, bookmarks and history.
How to add one
- Make a small square image (for example 32×32 or 512×512 pixels). PNG, SVG or ICO all work.
- Save it in your website folder, for example
favicon.png. - Add a
<link>tag inside<head>.
You can also add an apple-touch-icon for when people save your site to their phone home screen.
Example
Example — Add a favicon
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My Site</title>
<link rel="icon" type="image/png" href="/favicon.png">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
</head>
<body>
<p>Look at the browser tab for the icon.</p>
</body>
</html>