HTML Tutorial
The <head>
tag is a container for metadata about the HTML document. It provides information about the page's title, character encoding, and other technical details essential for browsers and search engines to interpret the page correctly.
<head>
tag as the first element within the <html>
tag.<title>
for the page title<meta>
for character encoding, author, description, keywords, etc.<link>
for CSS stylesheets<script>
for JavaScript code<head>
tag before the <body>
tag.The <head>
tag supports the following attribute:
profile
: Specifies the URI of a resource describing the document's metadata profile.<head>
<title>My Website</title>
<meta charset="UTF-8" />
<meta name="author" content="John Doe" />
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
</head>
Exploring the <head>
Tag:
<!DOCTYPE html>
<html>
<head>
<title>Exploring the Head Tag</title>
</head>
<body>
<h1>Welcome to my Website</h1>
</body>
</html>
<head>
section to see the metadata information for the page.