HTML – The Head Element

HTML <head> Element

The <head> element contains meta-information about the HTML document. This information is not displayed on the webpage, but it is used by browsers, search engines, and other web services.

Common uses include setting the title, linking CSS/JS files, meta tags, and favicons.


Basic Syntax


 


Common Elements Inside <head>

Tag Purpose
<title> Sets the page title displayed in the browser tab
<meta> Provides metadata like charset, description, keywords
<link> Links external files like CSS or favicon
<style> Internal CSS styles
<script> Internal JavaScript
<base> Sets base URL for relative links

Example Code


 


Output Preview

  • Browser tab shows: My Webpage

  • Page text is styled with Arial font

  • Favicon appears in the tab

  • Metadata is used by search engines (not visible on page)

CodeCapsule

Sanjit Sinha — Web Developer | PHP • Laravel • CodeIgniter • MySQL • Bootstrap Founder, CodeCapsule — Student projects & practical coding guides. Email: info@codecapsule.in • Website: CodeCapsule.in

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *