đ§± 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