Home / Learn HTML / HTML Page Title and Favicon

HTML Page Title and Favicon

The title and the small icon on the browser tab are the first thing people notice.

In shortAdd <link rel="icon"> in the head and a short clear <title>.

Definition

The favicon is the small icon on the browser tab and in bookmarks. You add it with <link rel="icon" href="/favicon.ico">. Use PNG or SVG for sharp results, and an apple-touch-icon for phones. The title is the text on the tab.

Theory in plain words

Where they show<title> and link iconBrowser tabBookmark listSearch result
Where they show

What it is

The page title is the name of the tab. The favicon is the small icon next to it.

Why we use it

They help people recognise your site among many tabs and bookmarks, and build trust.

How it works

The title element supplies the text. A link rel="icon" in the head points to the icon file.

Where it is used

  • Browser tabs
  • Bookmarks
  • Search results
Page titleTry it Yourself
Favicon (png)Try it Yourself
Favicon (svg, sharp on all screens)Try it Yourself
Several icon sizesTry it Yourself
Emoji favicon without a fileTry it Yourself
Change the title with JavaScriptTry it Yourself
Tip:Make the icon simple. It is shown at 16 pixels wide.

Quick quiz

1. Where is the favicon shown?

2. Which tag adds a favicon?

3. What is the best title length?

Common questions

Where is the favicon shown?

Browser tab. It is the small icon on the tab.

Which tag adds a favicon?

<link rel="icon">. Use link with rel icon.

What is the best title length?

About 50 to 60 letters. Short titles fit in search results.

My notes
Ask a question about this lesson