What is the <head> Tag?
The <head> tag in HTML contains metadata and links to external resources for the webpage. It does not display content directly on the page, but it’s critical for SEO, styling, scripting, and defining document information.
Syntax:
<head>
<!-- Metadata and resources -->
</head>
Common Elements Inside <head>:
<title>– Sets the page title in the browser tab<meta>– Defines metadata like character set, description, keywords<link>– Used to include external CSS stylesheets<script>– Includes or links to JavaScript files<style>– Defines internal CSS styles
Live Example
Output Explanation:
Although nothing visually appears from the <head> tag, it’s essential for:
- Search engines (SEO)
- Social sharing previews
- Responsive design (viewport settings)
- Connecting external styles/scripts
Important Tips:
- The
<head>section must be placed before the<body>tag. - Use
<meta charset="UTF-8">to ensure correct character encoding. - Always include a
<title>for usability and SEO.

