The <head> holds information about the page. Nothing here is shown in the page body, but it is very important.
| Tag | Purpose |
|---|---|
<title> |
Text in the browser tab and Google results |
<meta charset="UTF-8"> |
Correct display of all characters |
<meta name="viewport"> |
Correct size on mobile phones |
<meta name="description"> |
Summary shown in Google results |
<link rel="stylesheet"> |
Connects a CSS file |
<script src="..."> |
Connects a JavaScript file |
<link rel="icon"> |
The favicon |
Example
Example — A well-filled head
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Learn HTML Free | AgyanAdda</title>
<meta name="description" content="Free HTML tutorial with examples you can run online.">
<link rel="stylesheet" href="style.css">
<script src="app.js" defer></script>
</head>
<body>
<h1>Welcome</h1>
</body>
</html>
defer loads the script without blocking the page.
Try it Now »