HTML Head

  • The HTML head serves as the container for metadata (information about data). It is placed between the <html> and <body> tag. Metadata is not displayed on the web pages. The metadata contains document titles, styles, character encoding, and other metadata-related information.

    HTML

    HTML Head Elements

    Following are the commonly used elements in HTML head.

    HTML <title> Element

    The title of a document, whether in HTML or XHTML, is defined by the HTML <title> element. A document can have only one single <title> element. It describes the title of a document for the browser tab, search engine results, and favorite page.

    HTML

    HTML <style> Element

    To add style information to an HTML page, the HTML <style> element is used. It is used for a single HTML page and can have CSS properties.

    HTML

    HTML <link> Element

    The <link> element links an external style sheet to the webpage. The two main attributes of the HTML <link> element are “rel” and “href,” where the former indicates the document is a stylesheet and the latter is the way to an external file.

    HTML

    HTML <meta> Element

    The <meta> element is not displayed on the webpage, but search engine browsers use this information to display the content. It specifies the character set, page description, keywords, and other details related to a webpage’s metadata.

    HTML

    HTML <script> Element

    This HTML element is used to define the client’s JavaScript.

    HTML

    The HTML <base> Element

    The base URL and all the relative URLs in the webpage are targeted by the <base> element. In a document, only one <base> element can be used. It should either have an href attribute, a target attribute, or both. 

    HTML

    In this example, the <base href=”https://learning-axis.com/”> sets https://learning-axis.com/ as the base URL for all relative URLs in the document. The link <a href=”about-us/”> will resolve to https://learning-axis.com/about-us/.

  • Watch Video on YouTube

    HTML Head

  • HTML
    CSS
    JS
  • Ad #1
    Ad #2
    Scroll to Top