📖 Table of Contents
- 1. Introduction to HTML
- 2. Basic Structure of an HTML Page
- 3. Common HTML Tags
- 4. Understanding Attributes
- 5. Formatting Text
- 6. Adding Links & Images
- 7. Lists and Tables
- 8. Forms and User Input
- 9. HTML5 Semantic Elements
- 10. Multimedia: Audio & Video
- 11. Meta Tags & SEO
- 12. Accessibility (a11y)
- 13. Best Practices
- 14. Mini Project
- 15. Conclusion
1. Introduction to HTML
HTML (HyperText Markup Language) is the foundation of every website. It defines the structure and meaning of web content, helping browsers display text, images, and media correctly.
- HyperText: Connects pages using links.
- Markup: Uses tags to identify parts of content.
- Language: Follows specific syntax browsers can read.
2. Basic Structure of an HTML Page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My First Webpage</title>
</head>
<body>
<h1>Hello World!</h1>
<p>This is my first HTML page.</p>
</body>
</html>
This structure includes essential elements like the document type, metadata, and the visible body of the page.
<!DOCTYPE html> to ensure modern HTML5 rendering.3. Common HTML Tags
HTML uses tags to define content. Most tags have an opening and a closing form:
<p>This is a paragraph.</p>
<h1>to<h6>— Headings<p>— Paragraph<a>— Link<img>— Image<ul>,<ol>,<li>— Lists<table>,<tr>,<td>— Tables
4. Understanding Attributes
Attributes add extra information to HTML elements.
<a href="https://example.com" target="_blank">Visit Example</a>
href— Specifies the link destinationtarget="_blank"— Opens link in a new tab
5. Formatting Text
<strong>— Bold text<em>— Italicized emphasis<br>— Line break<blockquote>— Quoted text block
6. Adding Links & Images
<a href="https://google.com">Visit Google</a>
<img src="cat.jpg" alt="A cute cat">
alt text for images. It improves accessibility and search ranking.7. Lists and Tables
Unordered List
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ul>
Simple Table
<table>
<tr><th>Name</th><th>Age</th></tr>
<tr><td>Alice</td><td>25</td></tr>
</table>
8. Forms and User Input
<form action="/submit" method="post">
<label for="email">Email:</label>
<input type="email" id="email" name="email" required>
<input type="submit" value="Subscribe">
</form>
<label> with form inputs for accessibility.9. HTML5 Semantic Elements
HTML5 introduced elements that describe the meaning of content:
<header>— Page or section header<nav>— Navigation menu<section>— Thematic grouping of content<article>— Self-contained piece (e.g. blog post)<aside>— Sidebar or related content<footer>— Footer of page or section
10. Multimedia: Audio & Video
<video controls width="400">
<source src="movie.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<audio controls>
<source src="music.mp3" type="audio/mpeg">
</audio>
11. Meta Tags & SEO
Meta tags provide information about your page to search engines.
<meta name="description" content="Learn HTML step by step.">
<meta name="keywords" content="HTML, tutorial, beginner, web development">
12. Accessibility (a11y)
- Use
alttext for all images. - Ensure color contrast is high enough.
- Use ARIA labels for assistive tech where needed.
- Use headings in logical order (
h1→h6).
13. Best Practices
- Validate HTML with W3C Validator.
- Use lowercase for all tags and attributes.
- Organize your code with indentation.
- Keep structure semantic and meaningful.
14. Mini Project: Personal Profile Page
Try creating a simple “About Me” page using everything you’ve learned:
<header>
<h1>John Doe</h1>
<nav><a href="#about">About</a> | <a href="#contact">Contact</a></nav>
</header>
<main>
<section id="about">
<h2>About Me</h2>
<p>I am an aspiring web developer passionate about front-end design.</p>
</section>
</main>
<footer><p>© 2025 John Doe</p></footer>
15. Conclusion
HTML is the foundation of the web. With a few tags, you can create structured, accessible, and SEO-friendly content.
Combine HTML with CSS and JavaScript to build interactive, modern websites.
Comments
Post a Comment