Head Elements is a type of container that holds machine-readable information (metadata) about a web page.
But before this, I will teach you the structure of HTML.
<!DOCTYPE html>
<head lang="en">
<head>
</head>
<body>
</body>
</html>
This is the structure of html. Inside head elements, we put machine-readable information (metadata) about a web page. This data was not directly shown in your webpage. And why I saided "not directly" you will know after practicing this and also after this topics.
Inside body elements and we said elements becuase, like to form compound we need elements so like this to form web page we need elements. So The body element in HTML acts as the main container for all the visible content of a web page.
<element> called opening tag.
</element> called closing tag.
There are exactly 7 valid elements that can be placed directly between the <head>HERE</head> tag:
<title></title>
Purpose: Defines the title of the document.
Usage: Displays text in the browser's title bar or tab and is critical for SEO.
Note: Only one <title> element is permitted per document.
<meta>
Purpose: Specifies structured metadata such as character encoding, page description, author, and viewport settings.
Usage: Common examples include <meta charset="utf-8"> for encoding and viewport tags for mobile responsiveness.
<link>
Purpose: Specifies relationships between the current document and external resources.
Usage: Most frequently used to link external CSS stylesheets or to add a favicon to the browser tab.
<style>
Purpose: Contains internal CSS styling rules for the document.
Usage: Embeds styles directly within the page when an external stylesheet is not used.
<script>
Purpose: Embeds or references executable client-side JavaScript code.
Usage: Can point to an external file via the src attribute or hold raw script logic.
<nonscript>
Purpose: Provides alternative content for users who have disabled JavaScript or use a browser that does not support it.
Usage: Typically displays a message warning the user that the site requires scripts to function properly.
<base>
Purpose: Defines the base URL and target for all relative URLs contained within the document.
Usage: There can be a maximum of one <base> element per page.