What is the HTML <head> Tag?
The <head> tag in HTML is a container for metadata (data about the webpage). It is placed between the <html> and <body> tags and does not display content directly on the webpage.
It includes important elements like:
- Page title
- Meta tags
- Styles (CSS)
- Scripts (JavaScript)
- Links (external files)
<head>
<title>My Website</title>
<meta charset="UTF-8">
<meta name="description" content="This is a beginner HTML page">
<meta name="keywords" content="HTML, web development, beginner HTML">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
What are Meta Tags?
Meta tags provide information about the webpage to browsers and search engines. They are placed inside the <head> section and are not visible to users.
Common Meta Tags Explained
-
<meta charset="UTF-8">
Defines character encoding (supports all languages) -
<meta name="description">
Describes the webpage for search engines (important for SEO) -
<meta name="keywords">
Lists keywords related to the page (less important today but still used) -
<meta name="viewport">
Makes the website responsive on mobile devices -
<meta name="author">
Specifies the author of the webpage
.png)
0 Comments