إعلانيمكن أن تكون علامتك التجارية هناعلامتك التجارية هنافي كل صفحة من Darslab · طلاب وأولياء أمور ومعلمونinfo@darslab.comاسأل عن الأسعارالأسعارinfo@darslab.com
☰ خطة العام · تكنولوجيا المعلومات والاتصالات (بالإنجليزية)

Folders and the structure of HTML

الأسبوع 8 · الوحدة ٣ «إنشاء صفحات الموقع» (١) الموضوع الأول لغة PHP وHTML وتطبيقات تصميم المواقع: ملفات ومجلدات المشروع، هيكل صفحة HTML، حفظ الصفحات واختبارها · 3 دروس
3

Headings, paragraphs and pictures

ICT Secondary 2 Term 1, Unit 3, Topic 1: pp. 56–68
GoalWrite headings, paragraphs, aligned text and a picture with valid HTML.
New words
headings · tags h1 to h6, where h1 is the largest and h6 the smallestparagraph · the p tag, a block of text that starts on a new lineimage · the img tag, which shows a picture from a filealignment · whether text sits at the left, centre or right
Explanation

Headings go from h1, the largest and most important, down to h6, the smallest. A paragraph is the p tag. To centre or right-align a paragraph, put the rule in a style attribute: <p style="text-align:center">. An image uses the img tag with two attributes: src, the path of the picture file, and alt, a short text that describes the picture for visitors who cannot see it or when the file does not load. Always write alt. The img tag stands alone, so it has no closing tag. Be careful with nesting: close a paragraph before you open a heading. A browser will close an open paragraph for you when a heading begins, but do not rely on that: write the closing tag yourself, so the code is clear and the same everywhere. Older pages used the tag <p align="center"> and capital letters; today we write valid, lowercase code.

TagJob
h1 … h6headings: h1 largest, h6 smallest
pparagraph
img (src, alt)picture from a file, with a description
brline break, no closing tag
Worked examples
Html
1<h1>Illustrated Dictionary</h1>
2<p style="text-align:center">Welcome to the club dictionary.</p>
3<img src="pic/router.webp" alt="A router with four cables" width="200">
4<h2>Latest term</h2>
5<p style="text-align:right">Router</p>
Output
From top to bottom: a large heading, a centred line of text, the picture (200 wide), a smaller heading, and a word on the right-hand side.
This part of a body uses a heading, a centred paragraph, a picture and a right-aligned paragraph. Predict the order on the page before you read the description.
Older habitValid way
<p align="center"><p style="text-align:center">
<img src="pic/a.webp"><img src="pic/a.webp" alt="description">
<p>Intro<h1>Title</h1><p>Intro</p><h1>Title</h1>
<H1>…</H1><h1>…</h1>
Mona compares older habits with valid HTML. The better version closes the paragraph before the heading, writes alt on the image and uses a style rule for alignment.
Class activity

On paper write the body of a page about your favourite animal: a main heading, a centred paragraph, a picture (src and alt) and a smaller heading with a right-aligned paragraph under it. Check that each paragraph is closed and each tag is lowercase.

Practice
1
Which heading tag is the largest and which is the smallest?
2
What do the attributes src and alt of an image say?
3
How do you centre a paragraph in valid HTML?
4
What is missing in <p>Hello<h1>Title</h1>? How do you fix it?