{{define "main-page"}}
This interactive tutorial will teach you HTML from the ground up. You'll learn by doing, with:
The tutorial adapts to your pace - if you're doing great, we'll move faster. If you need more practice, we'll provide it!
HTML stands for HyperText Markup Language. It's the standard language used to create web pages.
{{.Explanation}}
Every HTML document follows a basic structure. Think of it like a house - it needs a foundation, walls, and a roof!
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
<!DOCTYPE html> - Tells the browser this is HTML5<html> - The root element, contains everything<head> - Contains metadata (title, links to CSS, etc.)<body> - Contains the visible contentMost HTML elements have an opening tag and a closing tag (with a /). The content goes between them!
HTML uses tags to mark up content. Tags tell the browser how to display the content.
<h1> to <h6> - Headings (h1 is largest)
<p> - Paragraph
<a> - Link
<img> - Image
<div> - Division/container
<span> - Inline container
<p>This is a paragraph</p> ↑ ↑ ↑ Opening Content Closing Tag Tag
Most tags come in pairs, but some are self-closing like <img> and <br>.
Let's test your knowledge of HTML tags:
{{.Instructions}}
Remember: HTML tags have an opening tag <h1> and a closing tag </h1> with the content in between!
Attributes provide additional information about HTML elements. They're always specified in the opening tag.
<a href="https://example.com">Click me</a>
↑
Attribute
(name="value")
href - Link destination (for <a> tags)
src - Image source (for <img> tags)
alt - Alternative text for images
id - Unique identifier for an element
class - Class name for styling
<img src="logo.png" alt="Company Logo" width="200">
{{.Instructions}}
Tip: A paragraph tag looks like this: <p>Your text here</p>
Great job so far! You're ready for more advanced tags. Let's look at lists and semantic HTML.
<!-- Unordered List --> <ul> <li>Item 1</li> <li>Item 2</li> </ul> <!-- Ordered List --> <ol> <li>First</li> <li>Second</li> </ol>
<header> - Page or section header
<nav> - Navigation links
<main> - Main content
<article> - Self-contained content
<section> - Thematic grouping
<footer> - Page or section footer
These semantic tags make your HTML more meaningful and accessible!
You've completed the HTML Basics tutorial! You now know:
Continue your web development journey with: