html · level 3 · unit 3 · lesson 3
- meet it
- guess first
- your turn
- fix it
- nailed it
Tap a green word if you get lost.
meet it
<link rel="icon"> gives your site a .
A favicon is the little picture beside the page's name on a browser tab, next to a and in search results. Without one, the browser shows a plain grey globe, and your tab gets lost among the others.
Add <link rel="icon" href="logo.svg" type="image/svg+xml"> to the head. type says what kind of file it is. An SVG drawing stays sharp at every size, so one file does the job.
Favicons are often shown only 16 pixels wide, so keep the drawing bold and simple. A detailed logo turns into a smudge.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Pip's Plants</title>
<link rel="icon" href="logo.svg" type="image/svg+xml">
</head>
<body>
<h1>Pip's Plants</h1>
</body>
</html> Press show my page to see it here.
image/svg+xml is the official name for SVG files. A browser that cannot use an SVG icon skips it.
guess first
Where will logo.svg appear?
Guess before you run it. Wrong guesses are how you learn, and nothing is marked.
<head>
<title>Bake Street Bakery</title>
<link rel="icon" href="logo.svg" type="image/svg+xml">
</head>
<body>
<h1>Bake Street Bakery</h1>
</body>
your turn
Your turn. Add a favicon.
Give the football club a favicon: fill rel, href and type on line 6. The icon file is ball.svg.
Press show my page to see it here.
- the favicon is the footballnot checked yet
- it says the file is SVGnot checked yet
fix it
The tab shows a plain globe. Can you fix it?
Press show my page to see it here.
- the link is a real iconnot checked yet
- there is no made-up
relvaluenot checked yet
- The browser does not see this link as an icon. Look at the
relvalue. - Favicon is the everyday name, but the
relvalue browsers look for is shorter. - Change
rel="favicon"torel="icon"on line 6, then press run.
nailed it
your site has its own icon. :D
- A favicon shows on tabs, bookmarks and search results.
- Link it in the head with
rel="icon". - Keep the drawing bold, so it still works when tiny.
new words in your collection
- favicon
- bookmark
This lesson isn’t saved. A free account remembers every lesson you finish.