HTML Head


HTML HTML Head Html Metadata

Html <head> Element

This element is used as container for metadata (data about data) and not displayed on browser. This element is inside <html> tag and before <body> tag. Metadata is about Html document. It defines document title,styles,links,scripts and other meta information.

Example:-

<html> <head> <title> My First Page </title> </head> <body></body> </html>

Output:-

Html title

Elements used in <head> Element

  • <title> Element

    It defines title for Html document. Example is defined above.

  • <style> Element

    It defines style for Html page.

    Example:-

    <html> <head> <title>This is Page Title</title> <style> h6 {color: white; background-color:green;} </style> </head> <body> <h6>This is a Heading</h1> </body> </html>

    Output:-

    This is Page Title
    This is a Heading
  • <link> Element

    It defines link for external style sheet.

    Example:-

    <link rel="stylesheet" href="File-path">
  • <meta> Element

    It defines character set, page description, keywords, author, and other metadata..

    Example:-

    <meta charset="UTF-8">

    For type of character set.

    <meta name="description" content="Web Page Description">

    For description of web page.

    <meta name="keywords" content="HTML tutorial, Php tutorial,CSS tutorial, JavaScript tutorial">

    Keywords for search engines.

    <meta name="author" content="Ali">

    For Author of web page.

HTML Html Metadata Chapter Next »