🧱 HTML Basics – A Beginner’s Guide to Web Structure
HTML (HyperText Markup Language) is the foundation of every webpage. It defines the structure and content — like text, images, links, and forms — in a browser-readable format.
📦 Basic Structure of an HTML Document
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My First HTML Page</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>This is my first web page.</p>
</body>
</html>
Tag | Purpose |
---|---|
<!DOCTYPE> | Declares HTML5 version |
<html> | Root of the HTML document |
<head> | Metadata (title, styles, etc.) |
<body> | Visible content of the page |
📝 Common HTML Tags
📄 Text Tags
<h1> to <h6> <!-- Headings -->
<p> <!-- Paragraph -->
<strong> <!-- Bold -->
<em> <!-- Italic -->
<br> <!-- Line break -->
<hr> <!-- Horizontal line -->
🔗 Links and Images
<a href="https://example.com">Visit Site</a>
<img src=“logo.png” alt=“Logo” width=“200” />
📋 Lists
<ul> <!-- Unordered list -->
<li>Item 1</li>
<li>Item 2</li>
</ul>
<ol> <!– Ordered list –>
<li>Step 1</li>
<li>Step 2</li>
</ol>
📦 Containers and Layout
<div>Generic container</div>
<span>Inline container</span>
🧾 Tables
<table>
<tr>
<th>Name</th><th>Age</th>
</tr>
<tr>
<td>Anil</td><td>28</td>
</tr>
</table>
📤 Forms (Basic)
<form action="/submit" method="POST">
<label for="name">Name:</label>
<input type="text" id="name" name="name" required />
<button type="submit">Submit</button>
</form>
✅ Semantic HTML (Better Structure)
Use these tags to give meaning to your layout:
<header> <!-- Page or section header -->
<nav> <!-- Navigation links -->
<main> <!-- Main content -->
<article> <!-- Blog post or similar -->
<section> <!-- Thematic grouping -->
<footer> <!-- Page footer -->
🧠 HTML Attributes
Attributes provide extra information about an element:
<a href="https://example.com" target="_blank" title="Visit">Visit</a>
Attribute | Description |
---|---|
href | Link target |
src | Image source |
alt | Image description |
id / class | Used for styling or scripting |
type / value / name | Used in forms |
🔍 Tips for Beginners
Always use proper nesting (tags inside tags)
Close all your tags (except self-closing like
<br>
or<img>
)Use
alt
text for images (for accessibility)Validate your HTML: https://validator.w3.org
✅ 1. 🔄 Interactive HTML Practice (Beginner-Friendly)
Use this platform to code and preview instantly:
📌 Start with this code snippet:
<!DOCTYPE html>
<html>
<head>
<title>My Practice Page</title>
</head>
<body>
<h1>Hello!</h1>
<p>This is my first HTML practice.</p>
<a href="https://www.google.com" target="_blank">Visit Google</a>
</body>
</html>
✅ 2. 🧾 Downloadable PDF Cheat Sheet
Would you like a PDF version of the HTML Basics Cheat Sheet (with tags, syntax, structure)?
🔽 I can generate a print-ready PDF for you.
👉 Just reply:
“Send the HTML cheat sheet PDF” — and I’ll provide it right here.
✅ 3. 🚀 Starter Project: HTML + CSS + JS
I can give you a simple mini project like:
📄 Personal Profile Page
📰 Simple Blog Layout
📋 Todo List (with JS)
🖼️ Image Gallery
👉 Just tell me what you’d like (e.g., “I want the blog layout”), and I’ll create a clean, ready-to-edit template for you.
✅ 1. HTML Basics Cheat Sheet (PDF)
🧾 A neatly formatted PDF covering:
Page structure
Common tags (text, images, links, forms, etc.)
Semantic HTML
Example snippets
Attribute reference
Best practices
🔧 Generating your downloadable PDF…
(I’ll share it in the next message.)
✅ 2. Starter Project (Choose One)
Pick one and I’ll send you the complete HTML + CSS + JS template:
🧍 Personal Profile Page
📰 Simple Blog Layout
📝 Todo List (with JavaScript)
🖼️ Image Gallery
🎨 Portfolio Website
📬 Contact Form Page