Module 4: HTML
Teaching Principle: Generate HTML with AI, then read it line by line and open it in a browser to verify it looks right.
Lesson 4.1 — HTML Tags and Structure
Duration: 50 minutes
Learning Objectives
- Explain what HTML is and its basic structure.
- Use common tags:
<h1>, <p>, <a>, <img>, <ul>.
- Understand the
<!DOCTYPE>, <html>, <head>, <body> skeleton.
- Open an HTML file in a browser to verify.
Instructor Notes
HTML describes the structure and content of a page. Show the skeleton first. Emphasize tags come in pairs. Have students open files in a browser every time.
Presentation Outline
- What is HTML? (5 min).
- The page skeleton (10 min).
- Headings, paragraphs, links, images (15 min).
- Lists (5 min).
- Live build + browser check (15 min).
Demonstration
- Create
index.html with the skeleton.
- Add a heading, paragraph, link, and image.
- Add an unordered list of hobbies.
- Open the file in a browser and verify rendering.
AI Prompts
- "Act as a web teacher. Generate a basic HTML page with a title, one heading, a paragraph, a link, and an image. Add comments explaining each tag."
- "Explain the difference between
<head> and <body> in HTML for a beginner."
Starter Code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My First Page</title>
</head>
<body>
<!-- TODO: add an h1, a paragraph, a link, and a list -->
</body>
</html>
Final Code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My First Page</title>
</head>
<body>
<h1>Welcome to My Page</h1>
<p>This is my first HTML page built with AI help.</p>
<a href="https://example.com">Visit Example</a>
<ul>
<li>Coding</li>
<li>Music</li>
<li>Sports</li>
</ul>
</body>
</html>
Exercises
- Exercise 1: Add an
<img> tag pointing to an online image and verify it loads.
- Exercise 2: Change the heading text and reload the page.
- Exercise 3: Add an ordered list (
<ol>) of your top 3 goals.
Homework
- Assignment 1: Build a 1-page "About Me" site with heading, paragraph, image, and list.
- Assignment 2: Ask AI to explain 5 HTML tags you used and paste the notes.
Quiz
- HTML stands for:
- a) Hyper Text Markup Language ✅
- b) Home Tool Markup Language
- c) Hyperlinks Text Management
- d) High Tech Modern Language
- Which tag shows the biggest heading?
- a)
<p>
- b)
<h1> ✅
- c)
<a>
- d)
<img>
- The
<head> section contains:
- a) Visible page content
- b) Metadata like title and charset ✅
- c) Images only
- d) Footer text
- To show a clickable link you use:
- a)
<p>
- b)
<a href="..."> ✅
- c)
<img>
- d)
<ul>
- You verify HTML by:
- a) Guessing
- b) Opening the file in a browser ✅
- c) Printing it
- d) Emailing it
Lesson 4.2 — Attributes and Images
Duration: 45 minutes
Learning Objectives
- Explain what an HTML attribute is.
- Use
href, src, alt, width, and height.
- Write accessible images with
alt text.
- Validate attributes by viewing the page.
Instructor Notes
Attributes give extra information to tags. Stress alt text for accessibility and SEO. Show broken src to teach verification.
Presentation Outline
- What are attributes? (10 min).
- Link attributes (
href, target) (10 min).
- Image attributes (
src, alt, size) (10 min).
- Accessibility with
alt (5 min).
- Live demo + check (10 min).
Demonstration
- Show
<a href="..." target="_blank"> opening in a new tab.
- Add an image with
src, alt, width, height.
- Break the
src on purpose; show the broken image icon.
- Fix it and verify.
AI Prompts
- "Generate an HTML snippet with an image that has src, alt, width, and height attributes, and explain why alt matters."
- "Show how to make a link open in a new tab using the target attribute."
Starter Code
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Attributes</title></head>
<body>
<!-- TODO: add a link with target=_blank and an image with alt -->
</body>
</html>
Final Code
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Attributes</title></head>
<body>
<a href="https://example.com" target="_blank">Open in new tab</a>
<img src="https://via.placeholder.com/150" alt="A placeholder image" width="150" height="150">
</body>
</html>
Exercises
- Exercise 1: Add an image with meaningful
alt text describing it.
- Exercise 2: Create a link that opens in a new tab and verify behavior.
- Exercise 3: Intentionally break a
src and describe what the browser shows.
Homework
- Assignment 1: Build a small page with 2 links and 2 images using proper attributes.
- Assignment 2: Write one sentence explaining why
alt text is important.
Quiz
- An attribute gives a tag:
- a) A color
- b) Extra information/settings ✅
- c) A new name
- d) Nothing
- The
href attribute is used for:
- a) Images
- b) Links ✅
- c) Paragraphs
- d) Headings
- The
alt attribute:
- a) Changes font size
- b) Describes an image for accessibility ✅
- c) Makes text bold
- d) Opens a link
target="_blank" makes a link:
- a) Close the page
- b) Open in a new tab ✅
- c) Turn red
- d) Delete itself
- A broken image
src shows:
- a) Nothing ever
- b) A broken image icon ✅
- c) The alt text only always
- d) A video
Lesson 4.3 — Forms and Inputs
Duration: 50 minutes
Learning Objectives
- Build a basic HTML form with inputs.
- Use
<form>, <input>, <label>, <textarea>, <button>.
- Understand the
action and method attributes (intro).
- Verify the form displays and labels are connected.
Instructor Notes
Forms collect user data. Teach <label for> linked to input id for accessibility. We won't process data yet (that's later modules), but show structure. Verify the form renders and is usable.
Presentation Outline
- What is a form? (5 min).
- Input types: text, email, password (15 min).
- Labels and accessibility (10 min).
- Textarea and button (10 min).
- Live build + check (10 min).
Demonstration
- Create a contact form with name, email, message.
- Link each label to its input with
for/id.
- Add a submit button.
- Open in browser and test typing in fields.
AI Prompts
- "Generate an HTML contact form with name, email, and message fields, each with a linked label. Add comments."
- "Explain the difference between text, email, and password input types."
Starter Code
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Form</title></head>
<body>
<!-- TODO: build a form with name, email, message, and a submit button -->
</body>
</html>
Final Code
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Form</title></head>
<body>
<form>
<label for="name">Name:</label>
<input type="text" id="name" name="name"><br>
<label for="email">Email:</label>
<input type="email" id="email" name="email"><br>
<label for="msg">Message:</label>
<textarea id="msg" name="msg"></textarea><br>
<button type="submit">Send</button>
</form>
</body>
</html>
Exercises
- Exercise 1: Add a
password input to the form.
- Exercise 2: Add a
number input for age and link its label.
- Exercise 3: Change the button text and verify.
Homework
- Assignment 1: Build a "Sign Up" form with at least 4 fields and proper labels.
- Assignment 2: Ask AI to explain
action and method and summarize in your notes.
Quiz
- A form is used to:
- a) Show images
- b) Collect user input ✅
- c) Play music
- d) Hide text
- To link a label to an input you use:
- a)
for and id ✅
- b)
src and alt
- c)
href and name
- d)
class and style
<input type="email"> is useful because it:
- a) Changes color
- b) Validates email format in browsers ✅
- c) Sends email
- d) Deletes text
- The
<textarea> tag is for:
- a) Single-line text
- b) Multi-line text ✅
- c) Images
- d) Links
- A submit button uses:
- a)
<button type="submit"> ✅
- b)
<img>
- c)
<label>
- d)
<br>
Lesson 4.4 — Tables and Semantic HTML
Duration: 50 minutes
Learning Objectives
- Build a table with
<table>, <tr>, <th>, <td>.
- Use semantic tags:
<header>, <nav>, <main>, <footer>, <article>.
- Explain why semantics help accessibility and SEO.
- Combine tables and semantic layout in one page.
Instructor Notes
Tables are for tabular data, not layout. Semantic tags describe meaning, helping screen readers and search engines. Show a page with a header, nav, main, and footer.
Presentation Outline
- Tables: rows, headers, cells (15 min).
- Semantic tags overview (10 min).
- Why semantics matter (10 min).
- Live page with semantic layout + table (10 min).
- Verify structure (5 min).
Demonstration
- Build a "Course Schedule" table with headers.
- Wrap the page in
<header>, <nav>, <main>, <footer>.
- Open in browser; inspect with dev tools to show semantics.
- Discuss screen-reader benefits.
AI Prompts
- "Generate an HTML page using semantic tags (header, nav, main, footer) with a table of 3 students and their grades."
- "Explain why semantic HTML is better than using only divs."
Starter Code
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Semantic</title></head>
<body>
<!-- TODO: add header, nav, main with a table, and footer -->
</body>
</html>
Final Code
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Semantic</title></head>
<body>
<header><h1>School Portal</h1></header>
<nav><a href="#">Home</a> | <a href="#">Grades</a></nav>
<main>
<table border="1">
<tr><th>Name</th><th>Grade</th></tr>
<tr><td>Alex</td><td>A</td></tr>
<tr><td>Sam</td><td>B</td></tr>
</table>
</main>
<footer><p>© 2026 School Portal</p></footer>
</body>
</html>
Exercises
- Exercise 1: Add a
<thead> and <tbody> to the table.
- Exercise 2: Add an
<article> inside <main> with a paragraph.
- Exercise 3: Replace a
<div> with a semantic tag in your own page.
Homework
- Assignment 1: Build a "Product List" page using semantic tags and a table of 4 products.
- Assignment 2: Write 3 reasons semantic HTML matters.
Quiz
- Table row tag is:
- a)
<td>
- b)
<tr> ✅
- c)
<th>
- d)
<table>
- Table header cell uses:
- a)
<td>
- b)
<th> ✅
- c)
<tr>
- d)
<row>
- Semantic HTML helps:
- a) Only styling
- b) Accessibility and SEO ✅
- c) Making files larger
- d) Hiding content
- Which is a semantic tag?
- a)
<div>
- b)
<header> ✅
- c)
<span>
- d)
<br>
- Tables should be used for:
- a) Page layout
- b) Tabular data ✅
- c) Images
- d) Videos
← Back to Module README
الوحدة 4: HTML
مبدأ التدريس: ولّد كود HTML باستخدام الذكاء الاصطناعي، ثم اقرأه سطراً بسطر وافتحه في المتصفح للتأكد من مظهره الصحيح.
الدرس 4.1 — وسوم HTML والبنية
المدة: 50 دقيقة
أهداف التعلم
- شرح ما هو HTML وبنيته الأساسية.
- استخدام وسوم شائعة:
<h1>، <p>، <a>، <img>، <ul>.
- فهم الهيكل
<!DOCTYPE>، <html>، <head>، <body>.
- فتح ملف HTML في المتصفح للتحقق.
ملاحظات للمدرّب
يصف HTML بنية ومحتوى الصفحة. اعرض الهيكل الأساسي أولاً. أكّد أن الوسوم تأتي في أزواج. اجعل الطلاب يفتحون الملفات في المتصفح في كل مرة.
خطوط العرض
- ما هو HTML؟ (5 دقائق).
- هيكل الصفحة (10 دقائق).
- العناوين والفقرات والروابط والصور (15 دقيقة).
- القوائم (5 دقائق).
- بناء مباشر + فحص في المتصفح (15 دقيقة).
العرض العملي
- أنشئ
index.html بهيكل الصفحة.
- أضف عنواناً وفقرة ورابطاً وصورة.
- أضف قائمة غير مرتبة للهوايات.
- افتح الملف في المتصفح وتحقق من العرض.
أوامر الذكاء الاصطناعي
- "تصرّف كمدرّس ويب. ولّد صفحة HTML أساسية بعنوان وعنوان رئيسي واحد وفقرة ورابط وصورة. أضف تعليقات تشرح كل وسم."
- "اشرح الفرق بين
<head> و <body> في HTML للمبتدئ."
الكود الابتدائي
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My First Page</title>
</head>
<body>
<!-- TODO: add an h1, a paragraph, a link, and a list -->
</body>
</html>
الكود النهائي
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My First Page</title>
</head>
<body>
<h1>Welcome to My Page</h1>
<p>This is my first HTML page built with AI help.</p>
<a href="https://example.com">Visit Example</a>
<ul>
<li>Coding</li>
<li>Music</li>
&li>Sports</li>
</ul>
</body>
</html>
تمارين
- تمرين 1: أضف وسم
<img> يشير إلى صورة على الإنترنت وتأكد من تحميلها.
- تمرين 2: غيّر نص العنوان وأعد تحميل الصفحة.
- تمرين 3: أضف قائمة مرتبة (
<ol>) لأهم 3 أهداف لديك.
الواجب المنزلي
- واجب 1: ابنِ موقع "حولي" من صفحة واحدة بعنوان وفقرة وصورة وقائمة.
- واجب 2: اطلب من الذكاء الاصطناعي شرح 5 وسوم HTML استخدمتها والصق الملاحظات.
اختبار قصير
- HTML تعني:
- أ) Hyper Text Markup Language ✅
- ب) Home Tool Markup Language
- ج) Hyperlinks Text Management
- د) High Tech Modern Language
- أي وسم يظهر أكبر عنوان؟
- أ)
<p>
- ب)
<h1> ✅
- ج)
<a>
- د)
<img>
- قسم
<head> يحتوي على:
- أ) محتوى الصفحة المرئي
- ب) بيانات وصفية مثل العنوان والترميز ✅
- ج) الصور فقط
- د) نص التذييل
- لعرض رابط قابل للنقر تستخدم:
- أ)
<p>
- ب)
<a href="..."> ✅
- ج)
<img>
- د)
<ul>
- تتحقق من HTML بـ:
- أ) التخمين
- ب) فتح الملف في المتصفح ✅
- ج) طباعته
- د) إرساله بالبريد
الدرس 4.2 — السمات والصور
المدة: 45 دقيقة
أهداف التعلم
- شرح ما هي سمة HTML.
- استخدام
href، src، alt، width، و height.
- كتابة صور متاحة بنص
alt.
- التحقق من السمات عبر عرض الصفحة.
ملاحظات للمدرّب
تضيف السمات معلومات إضافية للوسوم. أكّد على أهمية نص alt للوصول وسلمه محركات البحث. اعرض src معطوباً لتعليم التحقق.
خطوط العرض
- ما هي السمات؟ (10 دقائق).
- سمات الروابط (
href، target) (10 دقائق).
- سمات الصور (
src، alt، الحجم) (10 دقائق).
- إتاحة الوصول مع
alt (5 دقائق).
- عرض مباشر + فحص (10 دقائق).
العرض العملي
- اعرض
<a href="..." target="_blank"> يفتح في تبويب جديد.
- أضف صورة بـ
src، alt، width، height.
- أعطّب
src عمداً؛ اعرض أيقونة الصورة المعطوبة.
- أصلحها وتحقق.
أوامر الذكاء الاصطناعي
- "ولّد مقتطف HTML بصورة لها سمات src و alt و width و height، واشرح سبب أهمية alt."
- "أرني كيف تجعل الرابط يفتح في تبويب جديد باستخدام سمة target."
الكود الابتدائي
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Attributes</title></head>
<body>
<!-- TODO: add a link with target=_blank and an image with alt -->
</body>
</html>
الكود النهائي
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Attributes</title></head>
<body>
<a href="https://example.com" target="_blank">Open in new tab</a>
<img src="https://via.placeholder.com/150" alt="A placeholder image" width="150" height="150">
</body>
</html>
تمارين
- تمرين 1: أضف صورة بنص
alt وصفي ذي معنى.
- تمرين 2: أنشئ رابطاً يفتح في تبويب جديد وتحقق من السلوك.
- تمرين 3: أعطّب
src عمداً وصف ما يظهره المتصفح.
الواجب المنزلي
- واجب 1: ابنِ صفحة صغيرة برابطين وصورتين بسمات صحيحة.
- واجب 2: اكتب جملة واحدة تشرح سبب أهمية نص
alt.
اختبار قصير
- السمة تعطي الوسم:
- أ) لوناً
- ب) معلومات/إعدادات إضافية ✅
- ج) اسماً جديداً
- د) لا شيء
- سمة
href تُستخدم لـ:
- أ) الصور
- ب) الروابط ✅
- ج) الفقرات
- د) العناوين
- سمة
alt:
- أ) تغيّر حجم الخط
- ب) تصف الصورة لإتاحة الوصول ✅
- ج) تجعل النص غامقاً
- د) تفتح رابطاً
target="_blank" تجعل الرابط:
- أ) يغلق الصفحة
- ب) يفتح في تبويب جديد ✅
- ج) يتحول للأحمر
- د) يحذف نفسه
- صورة معطوبة
src تظهر:
- أ) لا شيء أبداً
- ب) أيقونة صورة معطوبة ✅
- ج) نص alt فقط دائماً
- د) فيديو
الدرس 4.3 — النماذج والمدخلات
المدة: 50 دقيقة
أهداف التعلم
- بناء نموذج HTML أساسي بمدخلات.
- استخدام
<form>، <input>، <label>، <textarea>، <button>.
- فهم سمات
action و method (مقدمة).
- التحقق من عرض النموذج وارتباط التسميات.
ملاحظات للمدرّب
تجمع النماذج بيانات المستخدم. علّم <label for> المرتبط بـ id المدخل لإتاحة الوصول. لن نعالج البيانات الآن (في وحدات لاحقة)، لكن اعرض البنية. تأكد من عرض النموذج وقابليته للاستخدام.
خطوط العرض
- ما هو النموذج؟ (5 دقائق).
- أنواع المدخلات: نص، بريد، كلمة مرور (15 دقيقة).
- التسميات وإتاحة الوصول (10 دقائق).
- textarea والزر (10 دقائق).
- بناء مباشر + فحص (10 دقائق).
العرض العملي
- أنشئ نموذج تواصل بالاسم والبريد والرسالة.
- اربط كل تسمية بمدخلها بـ
for/id.
- أضف زر إرسال.
- افتح في المتصفح واختبر الكتابة في الحقول.
أوامر الذكاء الاصطناعي
- "ولّد نموذج تواصل HTML بحقول الاسم والبريد والرسالة، كل منها بتسمية مرتبطة. أضف تعليقات."
- "اشرح الفرق بين أنواع المدخلات text و email و password."
الكود الابتدائي
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Form</title></head>
<body>
<!-- TODO: build a form with name, email, message, and a submit button -->
</body>
</html>
الكود النهائي
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Form</title></head>
<body>
<form>
<label for="name">Name:</label>
<input type="text" id="name" name="name"><br>
<label for="email">Email:</label>
<input type="email" id="email" name="email"><br>
<label for="msg">Message:</label>
<textarea id="msg" name="msg"></textarea><br>
<button type="submit">Send</button>
</form>
</body>
</html>
تمارين
- تمرين 1: أضف مدخل
password للنموذج.
- تمرين 2: أضف مدخل
number للعمر واربط تسميته.
- تمرين 3: غيّر نص الزر وتحقق.
الواجب المنزلي
- واجب 1: ابنِ نموذج "تسجيل" بأربعة حقول على الأقل وتسميات صحيحة.
- واجب 2: اطلب من الذكاء الاصطناعي شرح
action و method ولخّص في ملاحظاتك.
اختبار قصير
- يُستخدم النموذج لـ:
- أ) عرض الصور
- ب) جمع مدخلات المستخدم ✅
- ج) تشغيل الموسيقى
- د) إخفاء النص
- لربط تسمية بمدخل تستخدم:
- أ)
for و id ✅
- ب)
src و alt
- ج)
href و name
- د)
class و style
<input type="email"> مفيد لأنه:
- أ) يغيّر اللون
- ب) يتحقق من صيغة البريد في المتصفحات ✅
- ج) يرسل بريداً
- د) يحذف النص
- وسم
<textarea> مخصص لـ:
- أ) نص سطر واحد
- ب) نص متعدد الأسطر ✅
- ج) الصور
- د) الروابط
- زر الإرسال يستخدم:
- أ)
<button type="submit"> ✅
- ب)
<img>
- ج)
<label>
- د)
<br>
الدرس 4.4 — الجداول و HTML الدلالي
المدة: 50 دقيقة
أهداف التعلم
- بناء جدول بـ
<table>، <tr>، <th>، <td>.
- استخدام وسوم دلالية:
<header>، <nav>، <main>، <footer>، <article>.
- شرح سبب مساعدة الدلالة لإتاحة الوصول وسلمه محركات البحث.
- دمج الجداول والتخطيط الدلالي في صفحة واحدة.
ملاحظات للمدرّب
الجداول للبيانات المجدولة لا للتخطيط. الوسوم الدلالية تصف المعنى، مما يساعد قارئات الشاشة ومحركات البحث. اعرض صفحة بترويسة وتنقل ومحتوى وتذييل.
خطوط العرض
- الجداول: صفوف وعناوين وخلايا (15 دقيقة).
- نظرة عامة على الوسوم الدلالية (10 دقائق).
- لماذا تهم الدلالة (10 دقائق).
- صفحة مباشرة بتخطيط دلالي + جدول (10 دقائق).
- التحقق من البنية (5 دقائق).
العرض العملي
- ابنِ جدول "جدول المواعيد" بعناوين.
- غلّف الصفحة بـ
<header>، <nav>، <main>، <footer>.
- افتح في المتصفح؛ فحص بأدوات المطور لإظهار الدلالة.
- ناقش فوائد قارئات الشاشة.
أوامر الذكاء الاصطناعي
- "ولّد صفحة HTML باستخدام وسوم دلالية (header, nav, main, footer) مع جدول لـ 3 طلاب ودرجاتهم."
- "اشرح لماذا HTML الدلالي أفضل من استخدام divs فقط."
الكود الابتدائي
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Semantic</title></head>
<body>
<!-- TODO: add header, nav, main with a table, and footer -->
</body>
</html>
الكود النهائي
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Semantic</title></head>
<body>
<header><h1>School Portal</h1></header>
<nav><a href="#">Home</a> | <a href="#">Grades</a></nav>
<main>
<table border="1">
<tr><th>Name</th><th>Grade</th></tr>
<tr><td>Alex</td><td>A</td></tr>
<tr><td>Sam</td><td>B</td></tr>
</table>
</main>
<footer><p>© 2026 School Portal</p></footer>
</body>
</html>
تمارين
- تمرين 1: أضف
<thead> و <tbody> للجدول.
- تمرين 2: أضف
<article> داخل <main> بفقرة.
- تمرين 3: استبدل
<div> بوسم دلالي في صفحتك.
الواجب المنزلي
- واجب 1: ابنِ صفحة "قائمة منتجات" بوسوم دلالية وجدول لـ 4 منتجات.
- واجب 2: اكتب 3 أسباب تهمية HTML الدلالي.
اختبار قصير
- وسم صف الجدول هو:
- أ)
<td>
- ب)
<tr> ✅
- ج)
<th>
- د)
<table>
- خلية عنوان الجدول تستخدم:
- أ)
<td>
- ب)
<th> ✅
- ج)
<tr>
- د)
<row>
- HTML الدلالي يساعد في:
- أ) التنسيق فقط
- ب) إتاحة الوصول وسلمه محركات البحث ✅
- ج) تكبير الملفات
- د) إخفاء المحتوى
- أي التالي وسم دلالي؟
- أ)
<div>
- ب)
<header> ✅
- ج)
<span>
- د)
<br>
- يجب استخدام الجداول لـ:
- أ) تخطيط الصفحة
- ب) البيانات المجدولة ✅
- ج) الصور
- د) الفيديو
→ الرجوع إلى ملاحظات الوحدة