The Head Tag

Metadata, script links, stylesheet links, and other connections that take readers out of the immediate view of the webpage are all contained in the <head> section of an HTML document. Setting up the document's details and adding links to outside resources that alter the way the website looks and functions are essential tasks for this phase.
 

Key Elements Inside <head>:

  • <title>: Specifies the document's title that appears in the title bar or tab of the browser.
  • <meta>: Supplying information about the HTML content, including viewport settings, character set, description, and keywords that aid in SEO (Search Engine Optimization).
  • <link> is used to connect favicon icons and CSS files.
  • <style>: Can have internal CSS rules in it.
  • <script>: This is used to add JavaScript, either directly embedded or through an external link, to the document.

Example of a <head> section:

<head>
    <title>My Sample Website</title>
    <meta charset="UTF-8">
    <meta name="description" content="Free Web tutorials">
    <meta name="keywords" content="HTML, CSS, JavaScript">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="styles.css">
    <script src="script.js"></script>
</head>

logo

HTML

The Head Tag

Beginner 5 Hours

Metadata, script links, stylesheet links, and other connections that take readers out of the immediate view of the webpage are all contained in the <head> section of an HTML document. Setting up the document's details and adding links to outside resources that alter the way the website looks and functions are essential tasks for this phase.
 

Key Elements Inside <head>:

  • <title>: Specifies the document's title that appears in the title bar or tab of the browser.
  • <meta>: Supplying information about the HTML content, including viewport settings, character set, description, and keywords that aid in SEO (Search Engine Optimization).
  • <link> is used to connect favicon icons and CSS files.
  • <style>: Can have internal CSS rules in it.
  • <script>: This is used to add JavaScript, either directly embedded or through an external link, to the document.

Example of a <head> section:

<head>
    <title>My Sample Website</title>
    <meta charset="UTF-8">
    <meta name="description" content="Free Web tutorials">
    <meta name="keywords" content="HTML, CSS, JavaScript">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="styles.css">
    <script src="script.js"></script>
</head>

Similar Data Science Tutorials

Related tutotials

Frequently Asked Questions for html

line

Copyrights © 2024 letsupdateskills All rights reserved