Required Tags

You can't do without them

Every HTML document has a basic structure. The minimum required tags are as follows:

<!DOCTYPE html>

The <!DOCTYPE html> declaration is the first thing found inside a HTML document. This is not a tag, but it defines rules for the browser to render the content correctly.

<html>

The <html> </html> tags encompass all other tags on the page.

<head>

The <head> </head> tags encompass other tags that define the HTML page in greater detail. This content is largely used by the web browser and not displayed on the screen.

<meta charset="utf-8">

Meta tags provide information to the browser about the HTML document. This meta tag tells the browser what characters can and will be displayed. UTF-8 is the preferred charset for e-mail and web pages. You don't have to memorize this, but remember that your HTML document should include this tag inside the head tag (below or above the title tag).

<title>

The <title> </title> tags are found inside the <head> </head> tags. The title of your document is placed between these tags. The document title is displayed at the top of the browser and on the browser tabs.

<body>

The <body> </body> tags hold all the visible content of a HTML page. This includes images, text, links, lists, etc.

This is the order these required tags are found:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>
</title>
</head>
<body>
</body>
</html>

Activity

Here you can test out what you read, and achieve badges.

Hint

Use the shortcut keys to cut and paste these tags into different locations. The shortcut for cut is cmd+x (PC = ctrl+x). The shortcut for paste is cmd+v (PC = ctrl+v).

Instructions

Arrange the tags in this activity into the correct order.

  1. Cut and paste the tags to be in the correct order. See the hint for cut/paste instructions. Refer to the example above for help.
  2. When you have completed ordering the basic HTML document, look at the Output window and notice that nothing is displayed in this window. This is because we have no content in the body section. Ignore this for now.

HTML

CSS

JavaScript

Output