Menu
Coddy logo textTech

Basic Structure of an HTML

Part of the Fundamentals section of Coddy's HTML journey — lesson 2 of 60.

Every HTML document follows a simple structure. 

It starts with <!DOCTYPE html>, which tells the version of HTML we are using. 

This is followed by the <html> tag, which contains all the HTML content. 

Inside the <html> tag, we add the <body> tag, which holds all the visible content of the webpage.

Here’s a simple example:

<!DOCTYPE html>
<html>
    <body>
        This is some text.
    </body>
</html>

In this example, the text inside the <body> tag will be displayed as text on the webpage.

challenge icon

Challenge

Easy

You are given the base code of an HTML page. Place the following text inside the <body> tag:

To Infinity And Beyond!

Note that everything is case sensitive. For example:

To Infinity And Beyond!
to infinity and beyond!

are different things (notice the capital letters in the first line).

Cheat sheet

Every HTML document follows a basic structure:

  • <!DOCTYPE html> - declares the HTML version
  • <html> - contains all HTML content
  • <body> - holds all visible webpage content

Basic HTML structure:

<!DOCTYPE html>
<html>
    <body>
        This is some text.
    </body>
</html>

Try it yourself

<!DOCTYPE html>
<html>
    <body>
        <!-- Place the text below -->

    </body>
</html>
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Fundamentals