menu

html - 3 Topics

HTML5 APIs

DEEP DIVE INTO

html

Topic:html head Tag

menu

Defination of head tag

In HTML5, the <head> element is a container that is used to hold meta-information and other non-visible elements about an HTML document.

It's an essential part of the document structure and typically placed within the <html> element, but before the <body> 

html<!DOCTYPE html>
<html>
  <head>
    <!-- Meta-information and other document-related elements go here -->
  </head>
  <body>
    <!-- Visible content of the web page goes here -->
  </body>
</html>

Here are some common elements you can find within the <head> section of an HTML5 document:

  • Metadata Tags: These include <meta> tags that provide information about the character encoding, author, viewport settings, and more.

  • Title: The <title> element specifies the title of the web page, which is displayed in the browser's title bar or tab. It's also essential for search engine optimization (SEO).

  • Link: The <link> element is used to link external resources like stylesheets (CSS) and icons (favicon) to the HTML document.

  • Script: The <script> element is used to include JavaScript code in the document, either inline or by referencing external JavaScript files.

  • Base: The <base> element specifies a base URL for relative URLs within the document.

  • Style: The <style> element can contain embedded CSS styles if you don't want to use an external stylesheet.

  • Meta Viewport: A commonly used meta tag, <meta name="viewport">, is used to control how the web page is displayed on mobile devices.

  • Other Meta Tags: You can include other <meta> tags for various purposes, such as specifying the character encoding or providing metadata for social sharing.

The <head> section is primarily for document setup and metadata. It doesn't contain visible content that users see on the web page. Instead, it provides information to web browsers, search engines, and other user agents to ensure proper rendering and indexing of the web page's content.

1280 x 720 px