Tutorials HTML Introduction to HTML
Ch 1 / 21 Next →
Chapter 1 Beginner 8 min read Getting Started

Introduction to HTML

HTML (HyperText Markup Language) is the standard markup language for creating web pages. It forms the skeleton of every webpage — CSS adds style, JavaScript adds behaviour.

🎯 What you'll learn
What HTML is and how browsers use it
HTML document structure (DOCTYPE, head, body)
Tags, elements and attributes explained
How to write your very first HTML page
🚀
Sponsored
Learn Full-Stack Development — Join K2 Courses
Live mentoring · Real projects · Placement support · Certificate
Enroll Free
Advertisement
Google Ad — 728×90 Leaderboard

What is HTML?

HTML stands for HyperText Markup Language. Invented by Tim Berners-Lee in 1991, it is the backbone of the web. A browser reads HTML and renders it as the visual page you see.

Think of a webpage like a house — HTML is the structure (walls, rooms, doors), CSS is the interior design, and JavaScript is the electricity that powers everything.

<!DOCTYPE html>
Declares the document as HTML5. Always the very first line.
<html> … </html>
Root element that wraps the entire page.
<head> … </head>
Contains metadata — title, CSS links, charset. Not visible on page.
<body> … </body>
Everything visible on the page lives here.

Document Structure

Every HTML document follows the same basic skeleton:

HTML
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <title>Page Title</title>
</head>
<body>
  <h1>Hello World!</h1>
</body>
</html>
💡 Pro Tip
In VS Code, type ! and press Tab to auto-generate the full boilerplate instantly (Emmet).

Tags & Elements

Most HTML tags come in pairs — an opening tag <p> and a closing tag </p>. The content between them forms an element.

<a href="https://k2infocom.com"Visit K2infocom</a>
Opening tagAttributeValueContentClosing tag

Some elements are self-closing and do not need a closing tag:

HTML
<img src="photo.jpg" alt="A photo" />
<br />
<input type="text" placeholder="Enter name" />

Try It Yourself

Edit the HTML below and click ▶ Run to see the output live.

Live Editor
✎ Editor
👁 Preview
⚠ Common Mistake
Forgetting to close a tag is the most common HTML error. Every <p> needs a </p>.
Quick Check — Chapter 1

What does HTML stand for?

📄 Chapter Summary
  • HTML is the standard markup language for web pages.
  • Every HTML file starts with <!DOCTYPE html>.
  • A page has <head> and <body> sections.
  • Elements are made of opening tag, content, and closing tag.
  • Some elements like <img> are self-closing.
💡
Sponsored
Master CSS — The Next Step After HTML
56 chapters · Flexbox, Grid, Animations · Free to start
Start CSS →
Advertisement
Google Ad — 300×250 Medium Rectangle
Join WhatsApp Channel