• google plus

How to Work with Simple <head> and <body> Elements

In this how-to, you'll learn about the two main parts of an HTML document.

At it's simplest, an HTML document contains what can be thought of as a skeleton — the main structure of the page. It looks like this:


<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>

</body>
</html>

Every HTML document contains two main parts: the <head> element and the <body> element.

The <head> Element

The <head> element contains content that is not displayed on the page itself. Some of the elements commonly found in the <head> are:

  • Title of the page (<title>). Browsers typically show the title in the "title bar" at the top of the browser window.
  • Meta tags, which contain descriptive information about the page (<meta>).
  • Script blocks, which contain JavaScript for adding functionality and interactivity to to a page (<script>).
  • References (or links) to external style sheets (<link>).

The <body> Element

The <body> element contains all the content that appears on the page itself. Tags that can be placed within the scope of body tag will be covered in other how-tos.

Author: Chris Minnick
Chris is a prolific author and trainer, and the CEO of WatzThis?. His published books include Writing Computer Code, JavaScript for Kids, Coding with JavaScript For Dummies, Beginning HTML5 and CSS3 For Dummies, Webkit For Dummies, CIW eCommerce Certification Bible, and New Riders' XHTML.
About Webucator

Webucator provides instructor-led training to students throughout the US and Canada. We have trained over 90,000 students from over 16,000 organizations on technologies such as Microsoft ASP.NET, Microsoft Office, Azure, Windows, Java, Adobe, Python, SQL, JavaScript, Angular and much more. Check out our complete course catalog.