The HTML Head Element
The <head> element is a container for metadata — information about the document that is not displayed directly on the page. It must be the first element inside <html>, before <body>. Content in <head> is processed by the browser, search engines, and social media crawlers.
Common Head Elements
The most common children of <head> are: <title> (required, sets the browser tab text and SEO title), <meta> (provides metadata such as charset, viewport, description), <link> (links external resources like CSS files), <script> (links or embeds JavaScript), and <style> (embeds internal CSS). The <base> element sets a base URL and is rarely needed.
<title>— Browser tab title, SEO title<meta>— Metadata (charset, viewport, description…)<link>— External CSS, icons, fonts<script>— JavaScript<style>— Embedded CSS