Module 1: Getting Started with HTML
Create Your First HTML Document
Build a complete page with a doctype, language, head, title, and visible body content.
Create index.html and start with this document. Type it yourself once; the small details will become familiar quickly.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My First HTML Page</title>
</head>
<body>
<h1>Hello, web</h1>
<p>This page is made with HTML.</p>
</body>
</html>
The doctype tells the browser to use standards mode. The html element is the document root. Its lang attribute identifies the language of the page’s main content. The head contains metadata that is not displayed as ordinary page content. The body contains what visitors read, watch, or interact with.
The meta charset declaration tells the browser how the document is encoded. UTF-8 supports characters used by most languages. The viewport declaration helps the layout use the device’s actual viewport width on mobile devices. The title appears in the browser tab and is also used in bookmarks and search results.
Open the file in a browser. You should see the heading and paragraph, and the tab should display the title. If the page shows source code instead of rendering it, check that the file really ends in .html.