A Simple HTML Document - Exercise

Welcome to our free HTML tutorial. This tutorial is based on Webucator's Introduction to HTML Training course.

Contact Us or call 1-877-932-8228
A Simple HTML Document - Exercise

A Simple HTML Document

Duration: 5 to 15 minutes.

In this exercise, you will create your first HTML document by simply copying the text shown below. The purpose is to give you some sense of the structure of an HTML document.

  1. Open your editor (e.g., Visual Studio Code).
  2. Save the file as HelloWorld.html in the HTMLBasics/Exercises folder.
  3. Type the following exactly as shown:
    <!DOCTYPE HTML>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>Hello world!</title>
    </head>
    <body>
    	<p>
    		Hello world!
    	</p>	
    </body>
    </html>
  4. Save the file again and then open it in your browser by navigating to the file in your folder system and double-clicking on it. The page should appear as follows:Hello World

Solution:

HTMLBasics/Solutions/HelloWorld.html
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hello world!</title>
</head>
<body>
	<p>
		Hello world!
	</p>	
</body>
</html>
Next

This tutorial is based on Webucator's Introduction to HTML Training Course. We also offer many other HTML Training courses. Sign up today to get help from a live instructor.