Publish in HTML Tutorial el 24/05/2025 14:57
The <head> element is a crucial part of any HTML document, serving as a container for metadata and other essential information that isn't directly displayed on the web page itself. This invisible section provides browsers and search engines with critical details about your document.
Unlike content within the <body> tag, elements in the <head> typically include page titles, character set declarations, stylesheets, scripts, and meta information like descriptions and viewport settings. These elements help browsers render the page correctly and assist search engines in understanding your content.
Here's how a minimal <head> section looks in an HTML document:
A simple <head> section with essential metadata:
How to include external stylesheets in your <head>:
Adding JavaScript in the <head> (though typically better at end of <body>):
A <head> section optimized for search engines:
Changing the page title dynamically using JavaScript:
The <head> element might be invisible to users, but it's incredibly powerful for controlling how your page behaves and appears across different platforms and devices. Mastering its use will significantly improve your web development skills.
The <style> HTML element contains style information for a document, or part of a document. ...
The <strong> element is used to indicate that its content has strong importance, seriousnes...
The <span> element is an inline container used to mark up a part of a text or document. Unl...
The <source> element is used to specify multiple media resources for media elements like &l...
The <small> element is used to represent side-comments and small print, typically for discl...
HTML <section> Element: The Complete Guide The <section> element is a semantic HTML ...