Chapter 18mChallenge

HTML Editors — Challenge

Learn how to write HTML using Notepad, TextEdit, and VS Code. Create, save, edit, and open your first HTML page with practical examples.

Apply what you've learned. Each challenge includes starter code and test cases.

Create a basic HTML file

easy

Write the basic HTML document structure using <!DOCTYPE html>, <html>, <head>, and <body> tags.

STARTER CODE
<!DOCTYPE html>
<html>
<head>
</head>
<body>
</body>
</html>
4 test cases
Start Challenge

Format HTML code using indentation

easy

Write the following HTML structure with proper indentation: a body containing a div, and inside the div an h2 element with the text "About Us".

STARTER CODE
<body>

</body>
4 test cases
Start Challenge

Create a web page heading and paragraph

easy

Write an <h1> element displaying "Welcome to HTML" and a <p> element displaying "I am learning HTML." inside the <body> element.

STARTER CODE
<body>
<h1></h1>
<p></p>
</body>
2 test cases
Start Challenge

Complete an HTML element using editor suggestions

easy

Complete the anchor element so that it links to https://example.com and displays the text "Visit Website".

STARTER CODE
<a href=""> </a>
4 test cases
Start Challenge

Create a complete HTML web page

easy

Create a complete HTML document using <!DOCTYPE html>, <html>, <head>, and <body> elements. Set the page title to "My First Website" using the <title> element. Inside the <body>, add an <h1> heading displaying "Hello World" and a <p> paragraph displaying "This is my first web page."

STARTER CODE
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<h1></h1>
<p></p>
</body>
</html>
4 test cases
Start Challenge

Identify and fix an HTML syntax error

easy

The following HTML code has an incorrect closing tag. Rewrite it with the correct closing tag: <strong>Important Notice</p>

STARTER CODE
<strong>Important Notice</p>
4 test cases
Start Challenge