<head> Element

The <head> element provides information about the document.

 

  • Contains all the page header elements
  • Immediately follows the opening <html> tag
  • Should contain the <title> for the document

 

Can also contain the following tags:

  • <meta>
    • information about the document
    • e.g: keywords, description
    • useful for search engines
  • <link>
    • provides a link to an external file, such as a css stylesheet, or JavaScript file
  • <style>
    • provides css rules for the document
  • <script>
    • provides a container for JavaScript
  • <base>
    • provides a base URL for any relative links within the document
  • <object>
    • used to embed multimedia within the document

 

Example showing <head> element containing some of the above example tags:

Save & refresh browser:

Hello, World

Leave a Reply