🎯 Learning Objectives
- Understand the structure of HTML documents
- Master common HTML tags (headings, paragraphs, links, images, lists)
- Create a simple profile page with multiple elements
- Link multiple HTML pages together
- Apply semantic HTML principles
📚 Lecture Notes: HTML Document Structure
1. Basic HTML Template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Page Title</title>
</head>
<body>
<!-- Your content goes here -->
</body>
</html>
2. Heading Tags (H1 - H6)
HTML has six levels of headings, from <h1> (most important) to <h6> (least important).
<h1>Main Heading</h1>
<h2>Subheading</h2>
<h3>Sub-subheading</h3>
<h4>Minor heading</h4>
<h5>Even smaller</h5>
<h6>Smallest heading</h6>
Main Heading (H1)
Subheading (H2)
Sub-subheading (H3)
Minor heading (H4)
Even smaller (H5)
Smallest heading (H6)
3. Paragraph Tags
<p>This is a paragraph of text. It can contain multiple sentences.</p>
<p>This is another paragraph.</p>
4. Links (Anchor Tags)
<!-- External link -->
<a href="https://www.google.com">Go to Google</a>
<!-- Internal link -->
<a href="about.html">About Page</a>
<!-- Link that opens in new tab -->
<a href="https://www.github.com" target="_blank">GitHub</a>
<!-- Email link -->
<a href="mailto:info@example.com">Email Us</a>
5. Images
<!-- Basic image -->
<img src="photo.jpg" alt="Description of image">
<!-- Image with dimensions -->
<img src="logo.png" alt="Company Logo" width="200" height="100">
<!-- Image from URL -->
<img src="https://picsum.photos/300/200" alt="Random image">
💡 Important: Always include the alt attribute for accessibility and SEO.
6. Lists
Unordered Lists (Bullets)
<ul>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ul>
Ordered Lists (Numbered)
<ol>
<li>First step</li>
<li>Second step</li>
<li>Third step</li>
</ol>
7. Other Useful Tags
| Tag | Purpose | Example |
|---|---|---|
| <strong> | Bold/important text | <strong>Important!</strong> |
| <em> | Italic/emphasized text | <em>Emphasis</em> |
| <br> | Line break | Line 1<br>Line 2 |
| <hr> | Horizontal rule | <hr> |
| <div> | Container/division | <div>Content</div> |
| <span> | Inline container | <span>Text</span> |
💻 Main Activity: Build a Profile Page
Task: Create profile.html
Create a personal profile page in C:\xampp\htdocs\web_basics\profile.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Profile - [Your Name]</title>
</head>
<body>
<!-- Navigation -->
<nav>
<a href="index.html">Home</a> |
<a href="profile.html">Profile</a> |
<a href="contact.html">Contact</a>
</nav>
<hr>
<!-- Main Heading -->
<h1>About Me</h1>
<!-- Profile Image -->
<img src="https://via.placeholder.com/200" alt="My Photo" width="200">
<!-- Introduction -->
<h2>Introduction</h2>
<p>
Hello! My name is <strong>[Your Full Name]</strong>.
I am a student at <em>Next Step Innovation and Impact Space</em> learning web development.
</p>
<p>
I am passionate about technology and building websites.
This is my first profile page!
</p>
<!-- Education -->
<h2>Education</h2>
<ul>
<li>Bayero University Kano</li>
<li>Department: [Your Department]</li>
<li>Level: [Your Level]</li>
</ul>
<!-- Skills -->
<h2>Skills I'm Learning</h2>
<ol>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript (coming soon)</li>
<li>Git and GitHub</li>
</ol>
<!-- Hobbies -->
<h2>My Hobbies</h2>
<ul>
<li>Reading</li>
<li>Coding</li>
<li>Gaming</li>
</ul>
<!-- Social Links -->
<h2>Connect With Me</h2>
<p>
<a href="https://github.com/yourusername" target="_blank">GitHub</a> |
<a href="https://linkedin.com/in/yourusername" target="_blank">LinkedIn</a> |
<a href="mailto:your.email@example.com">Email</a>
</p>
<hr>
<!-- Footer -->
<p><small>© 2025 [Your Name]. All rights reserved.</small></p>
</body>
</html>
✏️ Practice Exercises
Exercise 1: Create a Contact Page
Create contact.html with:
- A heading "Contact Me"
- Your email address as a clickable link
- Your phone number
- Links to your social media (use placeholder if you don't have)
- Navigation links to home and profile pages
Exercise 2: Update Your Index Page
Add navigation links at the top of your index.html that link to:
- profile.html
- contact.html
Exercise 3: Image Gallery
Create a new page called gallery.html with:
- At least 4 images (use placeholder images from https://picsum.photos/)
- Each image should have a caption using a paragraph below it
- Organize images in an unordered list
📝 Quick Quiz
- What is the difference between <strong> and <b>?
- Why is the alt attribute important in img tags?
- What's the difference between <ul> and <ol>?
- How do you create a link that opens in a new tab?
- What tag is used for the most important heading?
✅ Today's Deliverable
Submit:
- profile.html (completed profile page)
- contact.html (contact page)
- gallery.html (image gallery)
- Updated index.html with navigation links
- Screenshot of all pages working in browser