Head Tag in HTML

In HTML, the Head element is a complex container within the document structure that holds metadata and other information about the HTML document itself, rather than the content that appears on the page. Here's a detailed explanation of the head element and its common use cases:

Purpose of the <head> Element

The head element is a container for metadata and other information about the HTML document. It does not directly display content to the user in the browser window but instead provides essential information and instructions to browsers and search engines.

Common elements or tags used within HEAD tag.

  1. Title : It is used to Sets the title of the HTML documents.
    • Syntax : <title>Tittle of the page</title>
  2. Meta data : It provides information about the HTML document itself rather than the content displayed on the page. It attributes includes viewport, author, charset, description,and keyword.
    • Syntax : <meta name=”keyword” description=”keyword1, keyword2,...”>
  3. External Resources : In this section, we can include external resources files. These can be JavaScript files, CSS files or both.
    1. For CSS file use <link> element :
      • Syntax : <link rel=”stylesheet” href=”filename.css”>
    2. For JavaScript use <script> Element.
      • Syntax : <Script src=”filename.js”></script>
  4. Internal or Inline Resources : Defines internal JavaScript and  CSS styles for the document.
    1. For CSS file use <style> element :
      • Syntax : <style><content></style>
    2. For JavaScript use <script> Element.
      • Syntax : <script><content</script>

    Example of <head> Element Structure

    Here's an example of how the <head> element is typically structured in an HTML document:


Comments

Popular posts from this blog

E-commerce UNIT- I Notes for BCA students

Animals and its Habitats Worksheet

Web Browser Worksheet ,Computer Worksheet