</> Code Corner

HTML · HTML Tutorial · Lesson 16

HTML Favicon

The small icon shown in the browser tab.

A favicon is a small image displayed next to the page title in the browser tab.

Save an image (for example favicon.ico or a PNG) in your site and add a <link> element with rel="icon" inside the <head>:

Example

<!DOCTYPE html>
<html>
<head>
  <title>My Page Title</title>
  <link rel="icon" type="image/x-icon" href="/images/favicon.ico">
</head>
<body>
  <h1>This is a Heading</h1>
</body>
</html>
Format Notes
ICO Supported by all browsers
PNG Supported by all modern browsers
SVG Scales perfectly; supported by modern browsers
GIF / JPEG Possible, but less common

Keep reading “HTML Favicon”

Sign up to read the full lesson, try every example in the live editor, and take the 5-question quiz.

Chat with us 👋