Introduction to HTML
HTML (HyperText Markup Language) is the standard language used to structure content on the web. It tells the browser how to display text, images, links, and other elements on a page.
Basic Document Structure
Every HTML page follows a simple skeleton:
Example
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>This is a simple HTML page.</p>
</body>
</html>
Key Points
- Tags: HTML uses tags (like
<h1>,<p>,<div>) to define elements. - Doctype: All pages start with
<!DOCTYPE html>to tell the browser it’s HTML5. - Head vs Body:
<head>contains metadata (title, styles, scripts).<body>contains the visible content.
- Hierarchy: Elements are nested inside each other to create structure.
Understanding the Skeleton
The skeleton is the blueprint every browser reads. Let’s break it down:
<!DOCTYPE html>: triggers standards mode.<html>: wraps all content on the page.<head>: houses title, links to CSS, meta tags.<body>: where headings, paragraphs, images, and interactivity live.
Try It Yourself
Copy this into a .html file and open it in any browser:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>My First HTML Page</title> </head> <body> <h1>Hello World</h1> <p>Welcome to HTML fundamentals.</p> </body> </html>
Quick Reference — Core Tags
<h1> - <h6>: Headings, define hierarchy<p>: Paragraph block<a>: Hyperlink<img>: Images<ul> / <ol>: Lists<div>: Generic container
HTML works together with CSS (styling) and JavaScript (interactivity) to create modern web experiences.