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

Replace REPLACE THIS TEXT inside the <body> tag with:

To Infinity And Beyond!

You do not need any tags here, just plain text.

Delete the whole REPLACE THIS TEXT line and type the sentence in its place, as plain text without quotation marks.

Try it yourself

<!DOCTYPE html>
<html>
    <body>
        <!-- Replace the line below with the required text -->
        REPLACE THIS TEXT
    </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

Practice on your own: Web playground