Back to subject
HTML5/Meta Tags and Favicon

Prepare the Browser Tab

Practical lesson

Let's read the most useful metadata in the <head> section and understand what each line is doing.

- <meta charset="UTF-8"> tells the browser how to decode the document's characters. - <meta name="viewport" content="width=device-width, initial-scale=1.0"> helps the page use a sensible viewport on mobile devices. - <title> gives the browser tab its title and is important for identifying the page. - <meta name="description" content="..."> can provide a short description that search engines and other systems may use. - <link rel="stylesheet" href="style.css"> connects an external CSS file to the page. - A favicon can be connected with a <link> element using the appropriate rel and href values. - Metadata belongs in <head>, not inside the visible content area of <body>. - Do not add random meta tags because you found them in an old tutorial; each metadata field should have a clear purpose.

The practical lesson is that <head> prepares important information and resources before the visible page content begins.

Try it yourself
Code

Starter example

Code
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="Learn HTML step by step.">
  <link rel="icon" href="favicon.ico">
  <title>Learn HTML</title>
</head>
Live preview