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
EasyYou 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>This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Fundamentals
1HTML Basics
What is HTML?Basic Structure of an HTMLTags and ElementsNesting and Closing TagsComments in HTML2Text and Formatting
HeadingsParagraphsLine BreaksBold and Italic TextBold and Italic AgainRecap - Formatting8Forms and Inputs Part 1
Form BasicsText InputsInput AttributesPassword FieldLabels for InputsRecap - Basic Form11Event Registration Page
Project OverviewHeader Section9Forms and Inputs Part 2
Radio ButtonsCheckboxesDropdownsButtonsButtons in FormsRecap - Forms #1Recap - Forms #2