![]() |
VOOZH | about |
The <head> tag in HTML is an essential element used to define the head section of an HTML document. It is placed inside the <html> tag, and used to store information that doesn't appear directly on the webpage itself.
HTML <head> tag is a type of container which has the following tags called <title>, <meta>, <link>,<style>,<script> and <noscript>.
The <title> tag is one of the most important parts of your <head> tag. It tells search engines and users what your page is about.
Syntax:
<head>
<title>Title of the document</title>
</head>The <meta> tag provides metadata about the document, such as the character set, description, and keywords. It also includes information for search engines, social media platforms, and browsers.
<meta charset="UTF-8"><meta name="description" content="This is a article for understanding the HTML head tag."><meta name="viewport" content="width=device-width, initial-scale=1">The <link> tag is used to link external resources to the document, most commonly stylesheets or icons like favicons.
<link rel="stylesheet" href="styles.css">The <style> tag allows you to write CSS directly within the HTML document, though external stylesheets are generally preferred for larger projects.
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f0f0;
}
</style>The <script> tag is used to include or reference JavaScript files that add interactivity and dynamic functionality to the webpage.
<script src="script.js" defer></script>The <noscript> tag defines alternative content for users whose browsers do not support or have disabled JavaScript.
<noscript>
Your browser does not support JavaScript or it is disabled.
</noscript>