HTML Basics Tutorial

Learn the fundamentals of HTML with this interactive guide

HTML Fundamentals

What is HTML?

HTML (HyperText Markup Language) is the standard markup language for creating web pages. It describes the structure of a web page using elements or "tags".

Basic HTML Structure

Every HTML document follows this basic structure:

<!DOCTYPE html>
<html>
<head>
  <title>Page Title</title>
</head>
<body>
  <!-- Content goes here -->
</body>
</html>

Common HTML Elements

Example:

<h1>My First Heading</h1>
<p>My first paragraph.</p>
<a href="https://www.example.com">Visit Example.com</a>
Tip: HTML tags usually come in pairs with an opening tag and a closing tag (e.g., <p> and </p>). Some tags are self-closing like <img> and <br>.

HTML Attributes

Attributes provide additional information about HTML elements. They are always specified in the opening tag.

<a href="https://www.example.com" target="_blank">Open in new tab</a>
<img src="photo.jpg" alt="A beautiful landscape" width="500">

Practice Area

Try editing the HTML code below and see the result in the preview:

<!DOCTYPE html> <html> <head> <title>My Practice Page</title> </head> <body> <h1>Welcome to My Page</h1> <p>This is a paragraph. Try editing me!</p> <h2>My Favorite Things</h2> <ul> <li>Learning HTML</li> <li>Creating websites</li> <li>Interactive tutorials</li> </ul> <p>Visit <a href="https://www.example.com">Example.com</a> for more information.</p> </body> </html>

Preview: