HTML Tags
HTML <head> Tag
The <head> tag contains machine-readable metadata about the document, such as its title, character set, styles, and links to resources.
What is the <head> tag?
The <head> element is a container for metadata that is not displayed directly on the page. It sits between the <html> and <body> tags. Content here is used by the browser, search engines, and other services rather than shown to the user.
A document has exactly one <head>, and it must contain a <title> element (unless the title is supplied by a higher-level protocol).
Elements allowed inside <head>
- <title> — the page title shown in the browser tab
- <meta> — character set, viewport, description and other metadata
- <link> — links to external resources such as stylesheets and icons
- <style> — embedded CSS
- <script> — JavaScript (often loaded with defer)
- <base> — the base URL for relative links
Complete example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Page With Metadata</title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<p>The head is not visible, but it configures this page.</p>
</body>
</html>Nothing inside <head> is rendered on the page except the <title>, which appears in the browser tab and bookmarks.
The <head> tag is supported in all browsers and has no notable attributes of its own.
