HTML The Head Element

HTML The Head Element
It does not display content directly on the page, but it is extremely important for:
SEO (search engines)
Page title & favicon
CSS & JavaScript linking
Responsiveness
Browser behavior
1. What Is the <head> Element?
Placed inside
<html>Comes before
<body>Contains information about the page, not visible content
2. Common Elements Inside <head>
<title> – Page Title (Mandatory)
- Shows in browser tab
- Used by search engines
<meta> – Metadata (Very Important)
Uses:
Character encoding
Mobile responsiveness
SEO description
<link> – External Files (CSS, Favicon)
- Links CSS & icons
<style> – Internal CSS
<script> – JavaScript (Optional)
- Usually placed at bottom of
<body> - Can also be used in
<head>withdefer
3. Complete Example of <head>
4. Why <head> Is So Important?
- Improves SEO ranking
- Controls page behavior
- Loads CSS & JS
- Enables responsive design
- Defines page identity
5. <head> vs <body>
| Feature | <head> | <body> |
|---|---|---|
| Visible content | No | Yes |
| Metadata | Yes | No |
| SEO info | Yes | No |
| CSS/JS links | Yes | No |
Common Mistakes
- Putting content text inside
<head> Missing<title>Forgetting viewport meta tag- Linking CSS in
<body>
Key Points to Remember
<head>stores metadataContent inside
<head>is not visible<meta viewport>is required for mobileCSS & favicon are linked here
