Welcome to the beginning of your HTML Zero → Advanced course.
Before writing lots of tags, you should understand what HTML actually does, how a browser processes it, and where HTML fits into web development.
HTML = HyperText Markup Language
HTML is the standard language used to define the structure and meaning of web pages.
For example:
<h1>Welcome to My Website</h1>
<p>This is my first webpage.</p>
<button>Click Me</button>HTML tells the browser:
HTML is not a programming language.
It doesn't normally perform logic like:
if (age >= 18) {
// ...
}Instead, HTML describes the structure of content.
A useful way to think about web development is:
HTML
↓
Structure
CSS
↓
Appearance
JavaScript
↓
BehaviorImagine you're building a house.
| Technology | House analogy | Purpose |
|---|---|---|
| HTML | Structure | Walls, rooms, doors |
| CSS | Interior design | Colors, spacing, appearance |
| JavaScript | Electricity & automation | Behavior and interaction |
For example:
<button>Buy Now</button>HTML creates the button.
CSS can make it look like:
┌─────────────────┐
│ Buy Now │
└─────────────────┘JavaScript can make something happen when the user clicks it.
When you visit:
https://example.coma lot happens behind the scenes.
At a simplified level:
User enters URL
↓
Browser sends request
↓
Web server
↓
HTML response
↓
Browser parses HTML
↓
DOM is created
↓
CSS is processed
↓
JavaScript executes
↓
Page is rendered
↓
User sees webpageFor example, the server might return:
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>The browser reads this document and constructs the webpage.
A webpage is essentially a document that contains structured content.
For example:
Website
│
├── Header
│ ├── Logo
│ └── Navigation
│
├── Main
│ ├── Heading
│ ├── Paragraph
│ ├── Image
│ └── Article
│
└── FooterHTML lets us express this structure.
HTML uses tags.
Example:
<p>Hello World</p>Here:
<p> → Opening tag
Hello World → Content
</p> → Closing tagTogether they form an HTML element.
┌─────────────────────────────┐
│ HTML Element │
│ │
│ <p> Hello World </p> │
│ ↑ ↑ ↑ │
│ Opening Content Closing │
│ tag tag │
└─────────────────────────────┘An HTML element generally consists of:
<tag>Content</tag>Example:
<h1>My Website</h1><p>Hello everyone</p><button>Submit</button>Each represents a different type of content.
Attributes provide additional information about an element.
Example:
<a href="https://example.com">Visit Website</a>Here:
<a> → Element
href → Attribute
URL → Attribute valueAnother example:
<img src="photo.jpg" alt="My photo">There are two attributes:
src → photo.jpg
alt → My photoGeneral syntax:
<tag attribute="value">Example:
<input type="text" placeholder="Enter your name">Almost every modern HTML document starts with a basic structure like this:
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
</head>
<body>
<h1>Hello World</h1>
<p>Welcome to my website.</p>
</body>
</html>Let's understand each part.
<!DOCTYPE html>#Tells the browser that this document uses modern HTML.
<!DOCTYPE html>It's called the DOCTYPE declaration.
<html>#The root element.
<html>
...
</html>Everything in the HTML document normally exists inside it.
<head>#Contains information about the document, rather than the primary visible page content.
<head>
<title>My Website</title>
</head>It can contain:
<body>#Contains the main content displayed on the webpage.
<body>
<h1>Hello World</h1>
<p>Welcome!</p>
</body>Create a file:
index.htmlPut this inside:
<!DOCTYPE html>
<html>
<head>
<title>My First Website</title>
</head>
<body>
<h1>Hello World!</h1>
<p>This is my first HTML webpage.</p>
</body>
</html>Save it.
Then open index.html in your browser.
You should see:
Hello World!
This is my first HTML webpage.🎉 You have created your first webpage.
Comments are ignored by the browser.
<!-- This is a comment -->You can write:
<h1>My Website</h1>
<!-- This section contains the introduction -->
<p>Welcome to my website.</p>Comments are useful for explaining your code.
HTML generally isn't case-sensitive for standard HTML element names.
These may be interpreted similarly:
<P>Hello</P>and:
<p>Hello</p>But the professional convention is:
<p>Hello</p>Use:
HTML elements can exist inside other elements.
Example:
<div>
<h1>My Website</h1>
<p>
Welcome to my website.
</p>
</div>Here:
<div>
│
├── <h1>
│
└── <p>This is called nesting.
Correct:
<p>
Hello <strong>Warrior</strong>
</p>Incorrect:
<p>
Hello <strong>Warrior</p>
</strong>Tags should be properly nested.
Not every HTML element has a closing tag.
For example:
<img src="photo.jpg" alt="Photo">There is no:
</img>Some commonly used void elements include:
<img>
<br>
<hr>
<input>
<meta>
<link>
<source>You'll learn these properly in later chapters.
HTML files normally use:
.htmlExamples:
index.html
about.html
contact.html
login.html
products.htmlThe most common starting page is:
index.htmlFor this course, use:
VS Code
Any modern browser:
Start with:
html-course/
│
└── index.htmlLater we'll build larger projects:
website/
│
├── index.html
├── about.html
├── contact.html
├── images/
├── css/
└── js/Your progression will look like:
HTML Basics
↓
Text & Links
↓
Images & Lists
↓
Tables
↓
Forms
↓
Semantic HTML
↓
HTML5
↓
Accessibility
↓
SEO
↓
Responsive HTML
↓
Performance
↓
Security
↓
DOM
↓
Browser Rendering
↓
HTML + CSS + JS
↓
React
↓
Next.js
↓
Production HTMLBy the end, you shouldn't just know HTML tags.
You should understand how to design correct, semantic, accessible, SEO-friendly, performant HTML structures for real applications.
Create index.html and build this:
My Portfolio
Hello, I'm Anubhav.
I am a software developer.
My Skills
- HTML
- CSS
- JavaScript
- React
- Next.js
Contact MeTry to create it without copying the exact solution.
Use what you've learned:
<!DOCTYPE html><html><head><title><body>Before moving forward, you should be able to answer:
<!DOCTYPE html>?<html>?<head> and <body>?index.html?Remember this mental model:
HTML
│
├── Document
│ ├── Head
│ └── Body
│
├── Elements
│ ├── Tags
│ ├── Content
│ └── Attributes
│
└── Structure
├── Headings
├── Paragraphs
├── Links
├── Images
├── Lists
├── Forms
└── Semantic sectionsWe'll go deeper into HTML document structure, tags, elements, attributes, nesting, block vs inline elements, HTML parsing, browser behavior, and how a real HTML document is constructed.
Mark it as complete to track your mastery.