<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:

<!DOCTYPE html>
		<title>Document Title</title>
		<meta name="description" content="Learning html">
			window.onload = function() {
				document.getElementById("myHeading").innerHTML = "Hello, World!");
		<base href="https://www.tech-academy.co.uk" />
		<h1 id="myHeading">Don't Display...</h1>

Save & refresh browser:

Hello, World

Leave a Reply