Loading...

HTML Introduction

HTML is the foundation of every web page you visit. Before CSS styling or JavaScript behavior, the browser needs a clear structure that says what each piece of content is.

What is HTML?

HTML (HyperText Markup Language) is the standard language used to structure content on web pages. You write tags around text and media so the browser knows which parts are headings, paragraphs, links, images, and other elements.

Why HTML matters

Without HTML, a browser cannot understand the meaning and order of content. HTML is not a programming language. It is a markup language: you mark up content so software (and people using assistive tools) can interpret it correctly.

A first look at tags

HTML uses tags written with angle brackets. Most elements have an opening tag and a closing tag.

Hello HTML

html
HTML Code
<!DOCTYPE html>
<html>
<head>
<title>My First Page</title>
</head>
<body>
<h1>Hello HTML</h1>
<p>This is my first paragraph.</p>
</body>
</html>

What this example shows

  • <!DOCTYPE html> tells the browser this is a modern HTML document
  • <html> is the root element of the page
  • <head> holds information about the page, such as the title
  • <body> holds the content visitors see
  • <h1> is a main heading
  • <p> is a paragraph

How a browser uses HTML

When you open an HTML file, the browser reads the markup from top to bottom, builds a structure called the DOM (Document Object Model), and displays the content according to those tags. The visible result is the page; the tags are the instructions behind it.

HyperText and links

The “HyperText” in HTML refers to text that can connect to other documents through links. Linking pages together is what turns separate files into a website.

A simple link

html
HTML Code
<a href="https://example.com">Visit Example</a>

The <a> element creates a hyperlink. The href attribute stores the destination address. You will study links in detail in a later session; here it is enough to know that links are part of what makes HTML “hyper.”

Try it yourself

Create a new file named index.html, paste the first full-page example, save it, and open the file in your browser. Change the heading text and refresh the page. You should see your new text immediately.

Common mistakes

  • Treating HTML as a programming language with loops and logic — use JavaScript for behavior later
  • Forgetting closing tags for elements that need them, which can break page structure
  • Putting visible page content in <head> instead of <body>
  • Skipping <!DOCTYPE html> and wondering why older layout quirks appear

Summary

  • HTML structures web page content with tags
  • It is a markup language, not a programming language
  • A basic page includes doctype, html, head, and body
  • Headings and paragraphs are common early elements
  • Links connect pages and create HyperText
  • Practice by editing a small HTML file and viewing it in a browser

🧠 Test Your Knowledge

Ready to Start

Test Your Knowledge

Challenge yourself with this interactive quiz and see how well you understand the topic

❓
8
Questions
🎯
70%
To Pass
♾️
∞
Time
🔄
∞
Attempts

📝 Instructions

  • Read each question carefully
  • Select the best answer for each question
  • You can retake the quiz as many times as you want
  • Your progress will be shown at the top