- Joined
- Oct 9, 2025
- Messages
- 38
1. What is HTML?
HTML stands for HyperText Markup Language.
It’s the core language used to structure web pages. Think of it as the skeleton of every website ,it organizes text, images, links, and other elements so browsers know how to display them.
When you open any site whether it’s Google, YouTube, or Facebook , underneath all that design and interactivity is HTML holding everything together.
Here’s the thing:
This tells the browser:
2. Tools You Need to Write and Run HTML Code
You don’t need anything fancy. Just two things:
A Text Editor (to write the code)
A Web Browser (to view the output)
A. Text Editors
These are where you’ll type and save your HTML files (.html).
For Laptop/Desktop (Windows, macOS, Linux):
If you’re coding on your phone, these work well:
B. Web Browsers
Any modern browser can open and render HTML files:
Then double-click it or open it in your browser you’ll instantly see your web page.
Writing Your First HTML Page
Step 1: Create a New File
Open your code editor (for example VS Code or Acode on Android).
The name “index.html” is the default file browsers look for when opening a website.
Step 2: Write the Basic HTML Structure
Every HTML page follows a core structure that looks like this:
Let’s break it down in plain English:
Step 3: Save and View Your Page
Now let’s see the output.
On Laptop/Desktop:
That’s your first live webpage running right on your computer.
On Android (using Acode or Dcoder):
Step 4: Experiment a Bit
Try changing your text:
Or add more lines:
Each time you save and refresh the page, your changes appear immediately.
Step 5: Folder Organization Tip
As you build more pages, keep them in one folder:
my-website/
│
├── index.html
├── about.html
└── images/
└── photo.jpg
That way, your site stays clean and easy to manage.
Understanding HTML Elements and Tags
Step 1: What Are Tags?
HTML is built with tags , they tell the browser what each part of your page is.
A tag usually comes in pairs:
Step 2: The Structure of an Element
Example:
Tags define the meaning of the content ,not how it looks (that’s CSS’s job).
Step 3: Common HTML Elements You’ll Use All the Time
1. Headings
Headings range from <h1> to <h6>.
<h1> is the largest, <h6> is the smallest.
<h1>Main Title</h1>
<h2>Subheading</h2>
<h3>Smaller Heading</h3>
Use them in logical order to organize your content.
2. Paragraphs
<p>This is a paragraph of text. It can span multiple lines but will appear as one block in the browser.</p>
3. Line Breaks and Horizontal Lines
4. Links (Anchors)
5. Images
6. Lists
Unordered list (bullets):
Ordered list (numbers):
7. Comments
Comments are invisible notes for you or other developers:
They don’t appear on the web page.
Step 4: Putting It All Together
Let’s combine what we learned:
Save it as index.html and open it in your browser.
You’ll instantly see a complete webpage with text, lists, a link, and an image.
Top 20 HTML Tags You Must Know
Bonus Tags (Useful to Know)
If you want to go further:
Complete Example Using 20+ Tags
Here’s a full working HTML file showing how these tags fit together.
What You’ll See When You Open It
HTML stands for HyperText Markup Language.
It’s the core language used to structure web pages. Think of it as the skeleton of every website ,it organizes text, images, links, and other elements so browsers know how to display them.
When you open any site whether it’s Google, YouTube, or Facebook , underneath all that design and interactivity is HTML holding everything together.
Here’s the thing:
- HTML doesn’t handle colors or layouts. That’s what CSS does.
- HTML doesn’t handle logic or interactivity. That’s what JavaScript does.
HTML’s job is simple: describe the structure and content.
HTML:
<h1>Hello, world!</h1>
<p>This is my first web page.</p>
This tells the browser:
- “Here’s a big heading”
- “Here’s a paragraph below it”
You don’t need anything fancy. Just two things:
These are where you’ll type and save your HTML files (.html).
For Laptop/Desktop (Windows, macOS, Linux):
- Visual Studio Code (VS Code) – free, popular, and perfect for beginners.
Download VS Code - Sublime Text – lightweight and fast.
Download Sublime Text - Notepad++ – simple and beginner-friendly (Windows only).
Download Notepad++
If you’re coding on your phone, these work well:
- Dcoder – full mobile IDE with HTML preview.
Dcoder on Play Store - Acode – clean, powerful HTML editor for Android.
Acode on Play Store - HTML Editor Lite – basic and lightweight option.
HTML Editor Lite
Any modern browser can open and render HTML files:
- Google Chrome
- Mozilla Firefox
- Microsoft Edge
- Safari (Mac/iPhone)
Then double-click it or open it in your browser you’ll instantly see your web page.
Writing Your First HTML Page
Step 1: Create a New File
Open your code editor (for example VS Code or Acode on Android).
- Create a new file.
- Save it as
The name “index.html” is the default file browsers look for when opening a website.
Every HTML page follows a core structure that looks like this:
HTML:
<!DOCTYPE html>
<html>
<head>
<title>My First Page</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>Welcome to my first website.</p>
</body>
</html>
Line | Explanation |
| <!DOCTYPE html> | Tells the browser this is an HTML5 document. |
| <html> | The start of your web page. Everything goes inside this tag. |
| <head> | Contains invisible information like the page title, description, and metadata. |
| <title> | The text that appears in your browser tab. |
| <body> | The visible part of your website — where your content lives. |
| <h1> | Heading (largest text). |
| <p> | Paragraph. |
Now let’s see the output.
On Laptop/Desktop:
- Save your file as index.html
- Locate it in your folder.
- Right-click → Open with → Chrome (or your browser)
Rich (BB code):
Hello, World!
Welcome to my first website.
That’s your first live webpage running right on your computer.
On Android (using Acode or Dcoder):
- Create and save a file named index.html
- Tap the Run/Preview button inside the app.
- It’ll open a small browser view showing your webpage instantly.
Try changing your text:
HTML:
<h1>My First HTML Page</h1>
<p>I’m learning HTML today!</p>
HTML:
<h2>About Me</h2>
<p>I love coding and creating new things on the web.</p>
As you build more pages, keep them in one folder:
my-website/
│
├── index.html
├── about.html
└── images/
└── photo.jpg
That way, your site stays clean and easy to manage.
Understanding HTML Elements and Tags
Step 1: What Are Tags?
HTML is built with tags , they tell the browser what each part of your page is.
A tag usually comes in pairs:
HTML:
<p>Hello!</p>
- <p> is the opening tag
- </p> is the closing tag
- Everything between them is the content
HTML:
<tagname>Content goes here</tagname>
Example:
HTML:
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
Tags define the meaning of the content ,not how it looks (that’s CSS’s job).
1. Headings
Headings range from <h1> to <h6>.
<h1> is the largest, <h6> is the smallest.
<h1>Main Title</h1>
<h2>Subheading</h2>
<h3>Smaller Heading</h3>
Use them in logical order to organize your content.
<p>This is a paragraph of text. It can span multiple lines but will appear as one block in the browser.</p>
HTML:
<p>This is line one.<br>This is line two.</p>
<hr>
<p>This paragraph comes after a horizontal line.</p>
- <br> breaks a line.
- <hr> draws a line across the page.
HTML:
<a href="https://www.google.com" target="_blank">Visit Google</a>
- href = where the link goes
- target="_blank" = opens link in a new tab
HTML:
<img src="photo.jpg" alt="A description of the photo" width="200">
- src = image file path
- alt = text shown if image can’t load
- width (and height) adjust the size
HTML:
<img src="https://picsum.photos/300" alt="Random photo">
Unordered list (bullets):
HTML:
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ul>
Ordered list (numbers):
HTML:
<ol>
<li>Learn HTML</li>
<li>Learn CSS</li>
<li>Learn JS</li>
</ol>
Comments are invisible notes for you or other developers:
HTML:
<!-- This section lists my skills -->
They don’t appear on the web page.
Let’s combine what we learned:
HTML:
<!DOCTYPE html>
<html>
<head>
<title>HTML Elements Demo</title>
</head>
<body>
<h1>Welcome to My Page</h1>
<p>This page shows basic HTML elements in action.</p>
<h2>Favorite Links</h2>
<a href="https://example.com" target="_blank">Visit Example Site</a>
<h2>My Hobbies</h2>
<ul>
<li>Reading</li>
<li>Coding</li>
<li>Music</li>
</ul>
<img src="https://picsum.photos/250" alt="Random image">
<hr>
<p>Thanks for visiting!</p>
</body>
</html>
Save it as index.html and open it in your browser.
You’ll instantly see a complete webpage with text, lists, a link, and an image.
Top 20 HTML Tags You Must Know
# | Tag | Meaning | Example |
| 1 | <!DOCTYPE html> | Tells the browser this is an HTML5 document. | <!DOCTYPE html> |
| 2 | <html> | The root element of every HTML document. | <html> ... </html> |
| 3 | <head> | Holds metadata (info about the page, not visible to users). | <head> <title>Page</title> </head> |
| 4 | <title> | Sets the title shown in the browser tab. | <title>My Website</title> |
| 5 | <meta> | Provides metadata like description, charset, or viewport. | <meta charset="UTF-8"> |
| 6 | <body> | Contains everything visible on the web page. | <body>Content here</body> |
| 7 | <h1>–<h6> | Headings — from largest to smallest. | <h1>Main Title</h1> |
| 8 | <p> | Paragraph of text. | <p>This is a paragraph.</p> |
| 9 | <br> | Line break. No closing tag. | Line one<br>Line two |
| 10 | <hr> | Horizontal rule (divider line). | <hr> |
| 11 | <a> | Link (anchor tag). | <a href="https://google.com">Google</a> |
| 12 | <img> | Displays an image. | <img src="photo.jpg" alt="Description"> |
| 13 | <ul> | Unordered (bulleted) list. | <ul><li>Item 1</li></ul> |
| 14 | <ol> | Ordered (numbered) list. | <ol><li>Step 1</li></ol> |
| 15 | <li> | List item (used inside <ul> or <ol>). | <li>HTML</li> |
| 16 | <div> | Block-level container for grouping content. | <div><p>Text</p></div> |
| 17 | <span> | Inline container for styling small parts of text. | <p>Hello <span>world</span></p> |
| 18 | <form> | Collects user input data. | <form action="/submit">...</form> |
| 19 | <input> | Input field inside a form. | <input type="text" placeholder="Your name"> |
| 20 | <button> | Clickable button. | <button>Submit</button> |
If you want to go further:
- <section> – divides content into sections.
- <header> – top section of a page or article.
- <footer> – bottom area, usually with contact info.
- <nav> – navigation bar.
- <article> – independent content (like a blog post).
- <strong> – bold text with importance.
- <em> – italic text (emphasis).
Here’s a full working HTML file showing how these tags fit together.
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Learn basic HTML structure and tags">
<title>My First Complete HTML Page</title>
</head>
<body>
<!-- Header Section -->
<header>
<h1>Welcome to My Website</h1>
<nav>
<a href="#home">Home</a> |
<a href="#about">About</a> |
<a href="#contact">Contact</a>
</nav>
<hr>
</header>
<!-- Main Content -->
<main>
<section id="home">
<h2>Home Section</h2>
<p>Hello there! This is my first HTML page. I’m learning <strong>HTML</strong> and <em>web development</em>.</p>
<p>Here’s a random image I like:</p>
<img src="https://picsum.photos/300" alt="Random image from Picsum" width="300">
</section>
<section id="about">
<h2>About Me</h2>
<p>My name is <span style="color:blue;">Chris</span>. I love coding, music, and technology.</p>
<h3>My Skills</h3>
<ul>
<li>HTML Basics</li>
<li>CSS Styling</li>
<li>JavaScript Fundamentals</li>
</ul>
<h3>My Learning Steps</h3>
<ol>
<li>Understand HTML structure</li>
<li>Practice every day</li>
<li>Build small projects</li>
</ol>
</section>
<section id="contact">
<h2>Contact Me</h2>
<form action="#" method="post">
<label for="name">Name:</label><br>
<input type="text" id="name" name="name" placeholder="Enter your name" required><br><br>
<label for="email">Email:</label><br>
<input type="email" id="email" name="email" placeholder="Enter your email" required><br><br>
<button type="submit">Send Message</button>
</form>
</section>
</main>
<!-- Footer -->
<footer>
<hr>
<p>© 2025 My First Website. All rights reserved.</p>
</footer>
</body>
</html>
- A title in your browser tab
- Navigation links (Home, About, Contact)
- Headings, paragraphs, image, lists, form, and footer
- Real use of over 20 HTML tags in one working page