Learn HTML Book - Mge
Learn HTML Book - Mge
E – HTML تعلم
M.G.E – HTML تعلم
فهرس الكتاب
5 Comments – التعليقات- 3
5 Headings – العناوين- 4
6 Paragraph – الفقرة- 5
8 Links – اللينكات- 7
9 Images – الصور- 8
11 Class and Id - 11
12 Lists – القوائم- 12
12 Tables – الجداول- 13
15 Forms – النماذج- 15
16 Input – الادخال- 16
21 Notes – ملاحظات- 18
-قالوا سبحانك لا علم لنا إلا ما علمتنا إنك أنت العليم الحكيم (البقرة )32
-اقرأ باسم ربك الذي خلق * خلق الإنسان من علق * اقرأ وربك الأكرم * الذي علم بالقلم *
علم الإنسان ما لم يعلم (العلق )5-1
وفي فضل طلب العلم كلام كثير و الانسان الذي يطلب العلم خير وافضل عند هللا من
الجاهل ..واذكر هنا مقولة من مقولات د.مصطفي محمود
"إذا نزل مؤمن وكافر إلى البحر فلا ينجو إلا من تعلم السباحة ،فاهلل لا يحابي الجهلاء
فالمسلم الجاهل سيغرق والكافر المتعلم سينجو"
فأدعو هللا ان يستفيد بهذا الكتاب البسيط كل طالب علم و ان يوفق كل إنسان لما يحبه
ويرضاه واذا تعلمت يا صديقي اي شئ فعلمه لغيرك حتي ولو بمقابل بسيط فلا تأخذ العلم
فخيرا لك ان تعلم غيرك بما تعلمته.
ً معك إلي قبرك فلن ينفعك
-لا تعتمد علي اي كتاب في العالم بأنه سيقدم او يشر ح لك كل شئ %100عليك بالبحث
المتواصل لتري الحقائق والتحديثات التي ظهرت في هذا الموضوع.
-تم اعداد هذا الكتاب بطر يقة بسيطة وخالية من اي حشو او اشياء اكاديمية بحتة
ومعظم/كل ما يحتويه هذا الكتاب ستستخدمه في عملك المستقبلي بإذن هللا ..وتم اعداده
بتجميع وتلخيص المحتوي من مصادر عربية واجنبيه
ورجاءا يا صديقي لا تقم ببيع هذا الكتا ب او التعديل عليه
ً امرا
فضلا وليس ً
فقط يمكنك نشر او طباعة هذا الكتاب بالمجان وفي اي مكان تر يد.
-اذا وجدت اي اخطاء بالكتاب لا تترد في مراسلتي علي ايميلي الشخصي هنا .
• الدومين – Domain
وهو لينك/رابط موقعك علي الانترنت وكل دومين يكون فر يد في اسمه وليس له اي شبيه
ويكون بإمتدادات مختلفة ..والصورة التالية توضح ما هو الدومين
• الاستضافة – Hosting
وهذه هي مساحة تخز ينية من سيرفر استضافة شركة ما يتم تأجيرها لمدة معينة ونربط بها
الدومين ونضع عليها قالب الموقع/ملفات الموقع.
هذا هو اساس ما سندرسه في المواضيع القادمة ويتم مرور صنع قالب الموقع بمراحل
تبدأ بمرحلة التصميم ثم تحويل التصميم إلي اكواد لكي يظهر لنا الموقع بشكله الحالي
علي شبكة الانترنت سواء كان موقع ذو محتوي ثابت Static Websiteاو محتوي ذو محتوي
يتم التفاعل معه . Dynamic Website
1
تعلم M.G.E – HTML
نأتي الان لندرس الــ HTML
• للعلم بالشئ اي لغة برمجية لابد انها تحتوي علي بعض الاساسيات التي تتشابه مع
بعضها البعض مثل الجمل الشرطية والتكرار علي سبيل المثال
وسندرس HTMLو CSSوهما ليسوا لغات برمجة اما JavaScriptو PHPلغات
برمجة.
• الـــ HTMLعبارة عن وسوم Tags/بيتم كتابتهم علي حسب وظيفة عمل كل
وسمTag/
2
تعلم M.G.E – HTML
شر ح سر يع للشكل العام
3
تعلم M.G.E – HTML
- 2الوسوم والعناصر والسمات/الصفات – Tags & Elements and Attributes
الشكل السابق وضح الفرق بين الوسم Tag/و العنصر Element/و السمة او
الصفةAttribute/
• وسم البداية – Opening Tagكان <( >aبدون السمة/الصفة ولكن في المثال وسم
البداية يشمل الـــ.) Attribute
• الصفة/السمة Attribute -بتتحط في وسم البداية ووظيفتها انها بتضيف معلومات
للعنصر لتغير طبيعته كما بالمثال او استدعاءه في محتوي اخر .
اللون الافتراضي هو الاس ود ولكن هنا وضعت سمة لكي اضيف معلومات تغير من
طبيعة العنصر ليظهر باللون الازرق بدل اللون الافتراضي الاسود.
• لكل سمة قيمة تسمي Attribute Valueوهذه القيمة تتغير بتغير الصفة او بتغير
قيمة محددة يتم ضبطها من المبرمج.
• محتوي العنصر – Element Contentيكتب ما بين وسمي البداية والنهاية.
• وسم النهاية – Closing Tagكان <.>a/
سنضع السمة/الصفة في الوسم وغالبا وسوم الاغلاق الذاتي ليس بها اي محتوي للوسم
ولكن السمة ستغير اشياء في طبيعة الوسم ..وسنري هذا في مواضيع لاحقة.
4
تعلم M.G.E – HTML
- 3التعليقات – Comments
التعليقات هدفها انها كملاحظات في الكود ولا يظهر التعليق في محتوي الموقع ولكن هو
يكون كمرجع للمبرمج حينما يتم التعديل علي الكود او الرجوع لسطر معين ..ويكون بهذا
الشكل
<!-- Comment1
Comment2
>Comment3 --
- 4العناوين – Headings
• هي 6وسوم تبدأ من h1إلي .. h6واكبرهم حجما في الخط h1و يتم النزول تنازليا
للوصول لاصغرهم حجما في الخط h6
• هذه الوسوم مهمة في تحسين محركات البحث – SEOبالأخص h1و h2
تدرب وقم بنسخ الاكواد ولصقها في محرر اكواد يناسبك وانظر النتيجة-: •
><h1>Hello World</h1
><h2>Hello World</h2
><h3>Hello World</h3
><h4>Hello World</h4
><h5>Hello World</h5
><h6>Hello World</h6
5
تعلم M.G.E – HTML
- 5الفقرة – Paragraph
Nestingاي التداخل.
6
تعلم M.G.E – HTML
• الوسم <>sub
يستخدم لكتابة نص علي مستوي منخفض من السطر ومكتوب بخط اصغر ويمكن
استخدامه في المعادلات الكيميائية.
><p>H<sub>2</sub>O</p
• الوسم <>br
يستخدم لاضافة سطر جديد او يمكننا القول انه يجعل اي شئ بعده يبدأ من سطر
جديد.
><b>Hello World</b> <br> <p> Hello World</p
• الوسم <>sup
يستخدم لكتابة نص علي مستوي مرتفع من السطر وم كتوب بخط اصغر ويمكن
استخدامه في المعادلات الر ياضية.
><p>2<sup>3</sup></p
• الوسم <>hr
يستخدم لاضافة خط بعرض سطر كامل في الصفحة ويمكن استخدامه في فصل
فقرات المواضيع بعضها البعض علي سبيل المثال.
• الوسم <>u
يستخدم لوضع خط تحت الكلام ويمكن استخدامه لوضع خط تحت النصوص المهمة.
• الوسم <>mark
لتظليل النص باللون الاصفر وهذا هو اللون الافتراضي.
• الوسم <>s
لوضع خط في منتصف النص اي كأنه مشطوب عليه.
• الوسم <>q
لوضع الكلام بين علامتي تنصيص " ".
• الوسم <>code
لكتابة كود غير مفعل ويظهر في صفحة الموقع.
• الوسم <>tt
لجعل الخط يظهر كأنه مكتوب علي الآلة كاتبة.
7
تعلم M.G.E – HTML
- 7اللينكات – Links
• اذا اردنا ان ندر ج لينك موقع او مقال او قسم بمقال في صفحة الموقع سيكون من
خلال وسم <>a
• اذا اردنا ان ندر ج ملف للتحميل عند النقر عليه ما علينا سوي كتابة اسم الملف
بإمتداده في قيمة السمة href
><a Href="download.rar"> download file </a
• اذا اردنا عند الضغط علي لينك يذهب بنا لارسال رسالة للايميل المكتوب في اللينك
الذي ضغطت عليه
><a href=mailto:[email protected]>contact us </a
• اذا اردنا عند الضغط علي لينك يذهب بنا للاتصال تليفونيا بالرقم الموجود في اللينك
الذي ضغطت عليه
><a href=tel:123456789> call us </a
8
تعلم M.G.E – HTML
• اذا كنت تر يد وضع اهم عناوين الفقرات في بداية المقال وعندما يتم الضغط عليه
ينتقل للفقرة في ا لمقال وذلك تيسيرا علي القارئ ومعرفة عناوين فقرات المقال
> </h1عنوان الفقرة>"<h1 id="head1
> </pنص الفقرة ><p
> </h1عنوان الفقرة>"<h1 id="head1
< >/pنص الفقرة <>p
• وسم ><link
يتم استخدامه بين وسمي > <headووظيفته هو لربط ملفات خارجية مثل CSS
وملفات اخري بملف الـ html
>"<link rel="stylesheet" href="style.css
• اذا كان المسار غير صحيح او تم حذف الصورة لن تظهر الصورة ولكن سيظهر
مساحة للصورة لذلك نستخدم السمة altلإ خبار محركات البحث والزائر ين بأن هنا
كانت توجد صورة ولكن توجد مشكلة بها وقيمة altيوكون وصف قصير للصورة.
9
تعلم M.G.E – HTML
– 9وسوم ذاتية الاغلاق – Self-closing
• تكلمنا سابقا بطر يقة سر يعة عنهم وشاهدنا وتدربنا علي وسم > <imgسنتكلم عنها
الان بإستفاضة
حيث انها وسوم ذات وسم بداية وليس لها وسم نهاية او بمعني ادق هي وسم وحيد
يغلق ذاتيا وهي وسوم معدودة علي الاصابع مثل
br / hr / img / input / meta / link / track / source
ه ولاء هم اشهر الوسوم الذي سوف تستخدمهم بإستمرار ويوجد وسوم ذاتية الاغلاق
اخري ولكن لن نتطرق إليهم حليا.
• معني Block level elementهو ان العنصر عندما يكتب يأخذ كامل السطر في
الصفحة ولا يأخذ بجانبه اي عناصر اخري ومن اشهر هذه العناصر علي سبيل المثال
• غير متاح ان عنصر inline levelيكون بداخله (التداخل) علي عنصر block level
10
تعلم M.G.E – HTML
Class and Id - 11
• Idقيمته تكون فر يدة وليس لها مثيل في اي عنصر اخر ..مثال للتوضيح
يمكننا كتابة قيمة idفي وسم > <pتسمي wall
يمكننا كتابة قيمة idفي وسم > <divتسمي sky
لا يحبذ ان نستخدم قيمة الـ idمرة اخري في اي عنصر من العناصر.
11
تعلم M.G.E – HTML
– 12القوائم – Lists
oفي كورس الـ CSSسنتعرف علي كيفية تغيير ترقيم القوائم المرتبة وتغيير
نقاط القوائم الغير مرتبة واضافة اشياء اخري.
- 13الجداول – Tables
12
تعلم M.G.E – HTML
• يتم إنشاء تذييل الجدول بطر يقتين
oمن خلال وسم > <tfootثم وسم > <trثم العناصر من اليسار لليمين بوسم
><td
oمن خلال وسم > <trوالعناصر من اليسار لليمين بوسم ><td
><table
><tr
></tr
><tr
><td> 19 </td
></tr
><tr
><td> 26 </td
></tr
></table
توجد بعض السمات التي تعمل علي تنسيق الجدول ولكنها قليلة ولن يتم التطرق لها •
الان وسنتطرق إليها في كورس الـ CSS
13
تعلم M.G.E – HTML
– 14اقسام الموقع – website sections
• يمكن تقسيم الموقع/المقال إلي عدة اقسام من خلال طر يقتين اولهما من خلال وسم
> <divويتم كتابة العناصر الاخري ب ين وسميه(وسم البداية ووسم النهاية لوسم
> ) <divوقد تكلمنا سابقا عنه وقلنا انه block level
• وسم > <spanايضا يمكننا استخدامه لتقسيم الموقع/المقال لعدة اقسام
ولكن هو inline level
14
تعلم M.G.E – HTML
– 15النماذج – Forms
• سمات attributes/النموذجform/
Action oيستخدم لربط صفحة phpلارسال البيانات المدخلة إلي هذه الصفحة
Autocomplete oلإخبار المتصفح انه يدخل البيانات المحفوظة لديه اتوماتيكا
للنموذج
Method oلإخبار بروتوكول httpما هي الوسيلة التي سيتم استخدامها لإرسال
البيانات هل هي postاو get
• لا تشغل بالك كثيرا بتلك السمات ولكن ضعها في ذهنك لاننا سنستخدمها عند تعلم
لغة phpوسيتوجب عليك حينها ان تكتب السمات بطر يقة صحيحة.
15
تعلم M.G.E – HTML
• Form labels
وسم > <labelهو inline levelواستخدامه الشائع هو لكتابة النصوص مع inputs
><label> I am a label </label
>"<input type="text
– 16الادخال – Input
• وسم > <inputله انواع كثيرة من خلال attributeالـ .. typeوانواع قيمة السمة هي
Text oلكتابة نص في حقل الادخال.
Radio oلإختيار اختيار واحد فقط من اختيارات متعددة.
Checkbox oلإختيار اختيار واحد او اكثر من اختيارات متعددة.
password oلكتابة باسورد ويظهر النص مخفي علي شكل نجوم.
Number oلكتبة رقم/عدد.
Email oلكتابة ايميل.
Tel oلكتابة رقم هاتف.
url oلكتابة رابط موقع.
Time oلإختيار وقت معين.
Date oلإختيار تار يخ معين.
Week oلإختيار رقم اسبوع معين (اسبوع/سنة).
Month oلإختيار شهر معين (شهر/سنة).
Color oلإختيا/معرفة اللون.
16
تعلم M.G.E – HTML
Fileلإختيار ملف وعمل له رفعupload/ o
Datetime-localلإختيار تار يخ وو قت معين. o
Hiddenلإخفاء قيمة الـ input o
Rangeيستخدم لوضع مقياس (تكبير او تصغير /رفع او خفض الصوت). o
Searchلعمل مربع بحث. o
Submitلارسال البيانات الي صفحة الـaction o
Resetلمسح كل المدخلات التي تم ادخالها. o
يوجد قيم اخري ولكن هؤلاء اشهرهم ويمكنك البحث عن جميع قيم o
input typeان اردت معرفة المز يد عنهم.
• Input attributes
Autocapitalize oتجعل كل الحروف كبيرةcapital/
Autocomplete oلإخبار المتصفح انه يدخل البيانات المحفوظة لديه اتوماتيكا
لمربع الادخال هذا ولكن اذا كانت مفعلة للنموذج كله فلاداعي لكتابتها هنا.
Value oتستخدم لتحديد القيمة الإفتراضية لمربع الادخال.
Autofocus oللتركيز علي المربع عن الكتابة فيه.
Disabled oلإلغاء تفعيل الكتابة في مربع الإدخال.
Max oلتحديد اكبر قيمة تكتب.
Min oلتحديد اصغر قيمة تكتب.
Maxlength oلتحديد اكبر طول ما يكتب (نص او رقم).
Minlength oلتحديد اقل طول ما يكتب (نص او رقم).
Multiple oلتحديد اكثر من شئ (علي سبيل المثال تستخدم في رفع ملفات).
Name oلكتابة اسم الحقل/مربع الادخال والذي سيرسل مع البيانات للـserver
Placeholder oلكتابة وصف للزائر ما سيكتب في مربع الادخال ويكون غير
مرئي عندما يكتب الزائر في حقل الادخال.
Required oمعناها ان مربع الادخال هذا مطلوب الإدخال فيه ولا تتركه فارغا.
Spellcheck oلتصحيح الكلمات المكتوبة خطأ (الاخطاء الاملائية) من قبل
الزائر اذا كانت القيمة trueاما القيمة falseفلا يتم التحقق من الاخطاء.
For oتكتب في وسم > <labelوتستخدم لربط الوسم بوسم inputمن خلال
كتابة forفي وسم > <labelو idفي وسم > <inputوتكون قيمهم واحدة.
17
تعلم M.G.E – HTML
– 17وسوم اخري مهمة – Important other html tags
• وسم > <textareaيستخدم لكتابة نص في مربع قابل للز يادة او النقصان في الحجم
ومن attributesهذا الوسم
Rows oلوضع عدد الصفوف
Cols oلوضع عدد الاعمدة
Placeholder oلكتابة وصف للزائر ما سيكتب في حقل الادخال.
"اكتب رسالتك =< textarea id="ta" raws="5" cols="30" placeholder
>></teaxtareaهنا"...
• وسم > <iframeيستخدم لإدراج صفحة موقع اخر داخل موقعك او إدراج ملف مثل
ملف بصيغة pdfداخل موقعك ومن attributesهذا الوسم
Src oوتكو ن قيمته هو رابط الموقع او الملف المراد ادراجه بموقعي.
Scrolling oوتكون قيمته noاذا اردنا منع الزائر من عمل سكرول بالماوس داخل
ifram
Frameborder oوهو المسئول عن اظهار واخفاء حدود/اطار الـ iframeوتون
قيمته الافتراضية هي 1وهي اظهار الاطار او اذا اردنا اخفاءه فنكتب 0كقيمة.
Width oلتحديد عرض وسم iframeالمعروض في الموقع.
Height oلتحديد طول وسم iframeالمعروض في الموقع.
18
تعلم M.G.E – HTML
><video controls
>"<source src="morning.mp4" type="video/mp4
></video
هذه الاكواد لادراج ملف فيديو وتم الاستعانة بوسم > <sourceلوضع مسار الملف
وبالـ attributesمثل controlsفي وسم البداية لاظهار ازرار التحكم للملف من تشغيل
وايقاف وتكرار ..و ب srcلوضع مسار الملف و typeلإخبار المتصفح بنوع الملف
ويمكننا وضع نفس الملف بصيغ اخري لان بعض المتصفحات لاتتدعم الا صيغ
معينة.وتوجد بعض السمات الاخري التي يمكن اضافتها في وسم البداية سواء لوسم
الصوت او وسم الفيديو مثل
Widthلوضع عرض الوسم و heightلوضع طول الوسم بالصفحة
و Autoplayلتشغيل تلقائي للملف و loopلتكرار تشغيل الملف مرة اخري
و matedلعدم تشغيل الصوت في الملف.
• وسم ><head
تستخدم الوسوم بين وسمي > <head></headلإضافة معلومات عن الموقع وغير
ظاهرة للزائر ولكن تفيد الموقع مثل
oوسم > <metaفي محركات البحث عندما يبحث الزائر عن شئ ما فيظهر موقعنا
وهذا الوسم له قيمة كبيرة في تحسين محركات البحث او ما يسمي بــ SEO
يمكنك البحث عن هذا المصطلح وستندهش عندما تعرف قيمته لموقعك.
▪ <meta name="viewport" content="width=device-width, initial-
>"scale=1.0
ن ضيف هذا السطر لكي يتوافق موقعنا مع كل الاجهزة سواء كمبيوتر او موبايل او
تابلت او اجهزة بشاشات مختلفة.
19
تعلم M.G.E – HTML
>"▪ <meta charset="UTF-8
نضيف هذا السطر لتحديد نوع ترميز الصفحة وهذا هو ترميز يدعم اللغة العربية
والانجليز ية ويظهرهم بطر يقة صحيحة ويوجد ترميزات اخري ولكن هذا اشهرهم.
>"▪ <meta name="description" content="First Web page
نضيف هذا السطر لوصف الموقع بكلمات تسهل من عملية العثور عليه عند البحث.
>"▪ <meta name="keywords" content="HTML, first web page
نضيف هذا السطر لوصف الموقع ولكن من خلال كلمات محددة وهي غير مفيدة
لمحرك البحث Googleاو Bingولكن بعض محركات البحث الاخري تستخدمها.
• وسم ><title
وسم اساسي وفيه نكتب اسم الموقع الذي سيظهر اعلي نافذة المتصفح في
لسان Tab/النافذة.
• وسم ><link
وظيفته هو لربط ملفات خارجية مثل CSSوملفات اخري بملف الـ html
• يمكننا كتابة اكواد styleمن خلال وسم > <styleوهذا سنتكلم عنه في كورس الـ CSS
ويمكننا ايضا كتابة اكواد JavaScriptمن خلال وسم > <scriptوسنتكلم عنه في
كورس الجافا سكر يبت.
وسم > <svgيستخدم ايضا لرسم الرسومات علي صفحة الويب و لكن رسومات vector
قابلة للتحجيم
20
تعلم M.G.E – HTML
– 18ملاحظات – Notes
سنتكلم عن بعض الملاحظات الهامة في HTML
• مسارات الملفات – Files Paths
تكلمنا في الامثلة السابقة اذا اردنا ان ندر ج ملف او صورة لابد ان تركز في مسار
الملف هل هو في نفس مجلد folder/او في مجلد اخر
اذا كان في نفس المجلد يتم ادراج صورة علي سبيل المثال هكذا
هذه هي اشهر طر يقة تكتب اسم المجلدات ثم الملف ..ت وجد بعض الطرق الاخري
ولكن يخطئ او يوجد سهو عند بعض المبرمجين عند كتابتها ..فهذه الطر يقة جيدة لك.
• اذا اردنا كتابة بعض العلامات والاشكال المعينة مثل اكبر من واصغر من وغيرهم
هذه العلامات تسمي بـــ Character Entites
oلاعطاء مسافة بين كلمتين في نفس السطر.
< oلإضافة علامة اصغر من.
> oلإضافة علامة اكبر من.
© oلإضافة علامة ©
oإذا اردت القائمة الكاملة لهم اضغط هنا.
مبروك
انت حاليا خلصت معظم المسافة في تعلم HTML
21
M.G.E – HTML تعلم
w3schools – اسئلة واجابات موقع19
22
M.G.E – HTML تعلم
8. What is the correct HTML for creating a hyperlink?
o <a href="http://www.w3schools.com">W3Schools</a>
o <a>http://www.w3schools.com</a>
o <a name="http://www.w3schools.com">W3Schools.com</a>
9. Which character is used to indicate an end tag?
o <
o /
o ^
o *
10. How can you open a link in a new tab/browser window?
o <a href="url" target="new">
o <a href="url" target="_blank">
o <a href="url" new>
11. Which of these elements are all <table> elements?
o <thead><body><tr>
o <table><tr><tt>
o <table><head><tfoot>
o <table><tr><td>
12. Inline elements are normally displayed without starting a new line.
o True
o False
13. How can you make a numbered list?
o <ul>
o <dl>
o <ol>
o <list>
14. How can you make a bulleted list?
o <dl>
o <ol>
o <ul>
o <list>
15. What is the correct HTML for making a checkbox?
o <input type="checkbox">
o <input type="check">
o <check>
o <checkbox>
23
M.G.E – HTML تعلم
16. What is the correct HTML for making a text input field?
o <input type="text">
o <textfield>
o <textinput type="text">
o <input type="textfield">
17. What is the correct HTML for making a drop-down list?
o <list>
o <input type="dropdown">
o <select>
o <input type="list">
18. What is the correct HTML for making a text area?
o <input type="textarea">
o <input type="textbox">
o <textarea>
19. What is the correct HTML for inserting an image?
o <img src="image.gif" alt="MyImage">
o <image src="image.gif" alt="MyImage">
o <img href="image.gif" alt="MyImage">
o <img alt="MyImage">image.gif</img>
20. What is the correct HTML for inserting a background image?
o <body bg="background.gif">
o <body style="background-image:url(background.gif)">
o <background img="background.gif">
21. An <iframe> is used to display a web page within a web page.
o True
o There is no such thing as an <iframe>
o False
22. HTML comments start with <!-- and end with -->
o True
o False
23. Block elements are normally displayed without starting a new line.
o False
o True
24
M.G.E – HTML تعلم
24.Which HTML element defines the title of a document?
o <meta>
o <head>
o <title>
25. Which HTML attribute specifies an alternate text for an image, if the
image cannot be displayed?
o Title
o Src
o Alt
o Longdesc
26. Which doctype is correct for HTML5?
o <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 5.0//EN"
"http://www.w3.org/TR/html5/strict.dtd">
o <!DOCTYPE HTML5>
o <!DOCTYPE html>
27. Which HTML element is used to specify a footer for a document or
section?
o <bottom>
o <section>
o <footer>
28. In HTML, you can embed SVG elements directly into an HTML page.
o True
o False
29. What is the correct HTML element for playing video files?
o <movie>
o <media>
o <video>
30. What is the correct HTML element for playing audio files?
o <mp3>
o <sound>
o <audio>
25
M.G.E – HTML تعلم
31. The HTML global attribute, "contenteditable" is used to:
o Return the position of the first found occurrence of content inside
a string
o Specify whether the content of an element should be editable or
not
o Specifies a context menu for an element. The menu appears when
a user right-clicks on the element
o Update content from the server
32. In HTML, onblur and onfocus are:
o Style attributes
o HTML elements
o Event attributes
33. Graphics defined by SVG is in which format?
o HTML
o XML
o CSS
34.The HTML <canvas> element is used to:
o draw graphics
o display database records
o create draggable elements
o manipulate data in MySQL
35. In HTML, which attribute is used to specify that an input field must be
filled out?
o Validate
o Formvalidate
o Required
o Placeholder
36. Which input type defines a slider control?
o Search
o Slider
o Range
o Controls
26
M.G.E – HTML تعلم
37. Which HTML element is used to display a scalar measurement within a
range?
o <range>
o <gauge>
o <measure>
o <meter>
38. Which HTML element defines navigation links?
o <navigation>
o <nav>
o <navigate>
39. In HTML, what does the <aside> element define?
o A navigation list to be shown at the left side of the page
o The ASCII character-set; to send information between computers
on the Internet
o Content aside from the page content
40.Which HTML element is used to specify a header for a document or
section?
o <top>
o <section>
o <header>
o <head>
2 /2/1/3/2/3/1/3/1/3
2/1/3/3/1/1/3/3/1/4
3 /3/2/3/3/3/3/1/1/1
3 /3 /2/4/3/3/1/2/3/2
27
M.G.E – HTML تعلم
Interviews Questions – – اسئلة الانترفيو20
)edureka( من موقع
Elements Tags
Each tag has additional attributes that change the way the tag behaves or is
displayed. For example, a <input> tag has a type attribute, which you can use
to specify whether it’s a text field, checkbox, radio button or one of many more
options.
Attributes are specified directly after the name of the tag, inside the two
angled brackets. They should only ever appear in opening tags or in self-
closing tags. But, they can never be in closing tags.
28
M.G.E – HTML تعلم
Example:
Block Inline
To understand the code easily, you can add code comments to your HTML
document. These are not displayed in the browser, but they help you in leaving
notes for yourself and other developers as to what a section of HTML is for.
The start of the comment is denoted by <!– and the end is marked by — >.
Anything in the middle will be completely ignored, even if it contains
valid HTML.
29
M.G.E – HTML تعلم
For example:
Q6. What are the HTML tags used to display the data in the tabular form?
The list of HTML tags used to display data in the tabular form include:
Tag Description
30
M.G.E – HTML تعلم
Q7. How to create a Hyperlink in HTML?
The HTML provides an anchor tag to create a hyperlink that links one page to
another page. These tags can appear in any of the following ways:
Q8. Name some common lists that are used when designing a page.
There are many common lists used for design a page. You can choose any or a
combination of the following list types:
Definition list – The definition list displays elements in definition form like in a
dictionary. The <dl>, <dt> and <dd> tags are used to define description list.
Semantic HTML is a coding style. It is the use of HTML markup to reinforce the
semantics or meaning of the content. For example: In semantic HTML <b>
</b> tag is not used for bold statement as well as <i> </i> tag is used for
italic. Instead of these we use <strong></strong> and <em></em> tags.
31
M.G.E – HTML تعلم
Q10. How to create a nested webpage in HTML?
The HTML iframe tag is used to display a nested webpage. In other words, it
represents a webpage within a webpage. The HTML <iframe> tag defines an
inline frame.
For example:
<!DOCTYPE html>
<html>
<body>
<h2>HTML example</h2>
Use the height and width attributes to specify the size of the
iframe:
<iframe src="<a
href="https://www.edureka.co/">https://www.edureka.co/</a>"
height="300" width="400"></iframe>
</body>
</html>
An image map is used for linking many different web pages using a single
image. It is represented by <map> tag. You can define shapes in images that
you want to include as part of an image mapping.
No, hyperlinks can be used both on texts and images. The HTML anchor tag
defines a hyperlink that links one page to another page. The “href” attribute is
the most important attribute of the HTML anchor tag.
Syntax:
32
M.G.E – HTML تعلم
Q13. What is a Style Sheet?
33
M.G.E – HTML تعلم
Q15. What is a marquee?
Marquee is used for the scrolling text on a web page. It scrolls the image or
text up, down, left or right automatically. You should put the text which you
want to scroll within the <marquee>……</marquee> tag.
There are three tags that can be used to separate the texts:
<br> tag – Usually <br> tag is used to separate the line of text. It breaks the
current line and conveys the flow to the next line
<p> tag – This contains the text in the form of a new paragraph.
The difference between span and div is that a span element is in-line and
usually used for a small chunk of HTML inside a line,such as inside a paragraph.
Whereas, a div or division element is block-line which is equivalent to having a
line-break before and after it and used to group larger chunks of code.
Example:
<div id="HTML">
</div>
The purpose of using alternative texts is to define what the image is about.
During an image mapping, it can be confusing and difficult to understand what
hotspots correspond to a particular link. These alternative texts come in action
here and put a description at each link which makes it easy for users to
understand the hotspot links easily.
34
M.G.E – HTML تعلم
Q19. How to create a new HTML element?
You can create new elements for the document in the following way:
<script>
document.createElement )"myElement"(
</script>
<myElement>hello edureka!</myElement>
There are many type of HTML, such as, HTML 4.01 Strict, HTML 4.01
Transitional, HTML 4.01 Frameset, XHTML 1.0 Strict, XHTML 1.0 Transitional,
XHTML 1.0 Frameset, XHTML 1.1 etc. So, <!DOCTYPE html> is used to instruct
the web browser about the HTML page.
Syntax:
<iframe src="URL"></iframe>
Example:
Target to a link:
35
M.G.E – HTML تعلم
Q23. What are the entities in HTML?
The HTML character entities are used as a replacement for reserved characters
in HTML. You can also replace characters that are not present on your
keyboard by entities. These characters are replaced because some characters
are reserved in HTML.
Example:
<span style="color:#ffffff;">
</span>
36
M.G.E – HTML تعلم
Q27. What is the advantage of collapsing white space?
Q28. Is there any way to keep list elements straight in an HTML file?
By using indents, you can keep the list elements straight. If you indent each
sub nested list in further than the parent list, you can easily determine the
various lists and the elements that it contains.
Q29. Explain The Key Differences Between LocalStorage And SessionStorage
Objects.
In the case of a localStorage object, data will not delete when the browser
window closes. However, the data gets deleted if the browser window closes,
in the case of sessionStorage objects.
The data in sessionStorage is accessible only in the current window of the
browser. But, the data in the localStorage can be shared between multiple
windows of the browser.
Frames can make navigating a site much easier. If the main links to the site are
located in a frame that appears at the top or along the edge of the browser,
the content for those links can be displayed in the remainder of the browser
window.
37
M.G.E – HTML تعلم
Q31. How to insert a picture into a background image of a web page?
To insert a picture into the background image, you need to place a tag code
after the </head> tag in the following way:
Now, replace image.gif with the name of your image file. This will take the
picture and make it the background image of your web page.
Q32. What happens if you open the external CSS file in a browser?
When you try to open the external CSS file in a browser, the browser cannot
open the file, because the file has a different extension. The only way to use an
external CSS file is to reference it using <link/> tag within another HTML
document.
Q33. What is the hierarchy that is being followed when it comes to style
sheets?
If a single selector includes three different style definitions, the definition that
is closest to the actual tag takes precedence. Inline style takes priority over
embedded style sheets, which takes priority over external style sheets.
Q34. How do you create text on a webpage that allows you to send an email
when clicked?
To change the text into a clickable link to send an email, you need to use the
mailto command within the href tag. You can write it in the following way:
38
M.G.E – HTML تعلم
Q37. Are there instances where the text will appear outside of the browser?
By default, the text is wrapped to appear within the browser window. However,
if the text is part of a table cell with a defined width, the text could extend
beyond the browser window.
Q38. Write an HTML table tag sequence that outputs the following:
10 pcs 5 50
<table>
<tr>
<td>50 pcs</td>
<td>100</td>
<td>500</td>
</tr>
<tr>
<td>10 pcs</td>
<td>5</td>
<td>50</td>
</tr>
</table>
39
M.G.E – HTML تعلم
The default size for a text field is around 13 characters. However, if you include
the size attribute, you can set the size value to be as low as 1. The maximum
size value will be determined by the browser width. Also, if the size attribute is
set to 0, the size will be set to the default size of 13 characters.
Q42. What is the relationship between the border and rule attributes?
Default cell borders, with a thickness of 1 pixel, are automatically added
between cells if the border attribute is set to a nonzero value. Similarly, If the
border attribute is not included, a default 1-pixel border appears when the
rules attribute is added to the <table> tag.
HTML SVG is used to describe the two-dimensional vector and vector or raster
graphics. SVG images and their behaviors are defined in XML text files. So as
XML files, you can create and edit an SVG image with the text editor. It is
mostly used for vector type diagrams like pie charts, 2-Dimensional graphs in
an X, Y coordinate system.
</svg>
40
M.G.E – HTML تعلم
Images– png, jpg, jpeg, gif, apng, svg, bmp, BMP ico, png ico
Video– MPEG, AVI, WMV, QuickTime, RealVideo, Flash, Ogg, WebM, MPEG-4
or MP4
Cell Spacing is referred to as the space or gap between the two cells of the
same table. Whereas, Cell Padding is referred to as the gap or space between
the content of the cell and cell wall or cell border.
Example:
The first one is a static Web Page whereas the later one is a dynamic Web
Page.
41
M.G.E – HTML تعلم
HTML allows programmer to perform changes in the tags and use attribute
minimization whereas XHTML when user need a new markup tag then user can
define it in this.
HTML is about displaying information whereas XHTML is about describing the
information.
Inline CSS: It is used for styling small contexts. To use inline styles add the style
attribute in the relevant tag.
External Style Sheet: This is used when the style is applied to many pages. Each
page must link to the style sheet using the <link> tag. The <link> tag goes
inside the head section.
<head>
</head>
Internal Style Sheet: It is used when a single document has a unique style.
Internal styles sheet needs to put in the head section of an HTML page, by
using the <style> tag in the following way:
<head>
<style type="text/css">
hr {color:sienna}
p {margin-left:20px}
body {background-image:url("images/back40.gif")}
</style>
</head>
42
M.G.E – HTML تعلم
Q49. What are logical and physical tags in HTML?
Logical tags are used to tell the meaning of the enclosed text. The example of
the logical tag is <strong> </strong> tag. When we enclose the text in the
strong tag, it tells the browser that enclosed text is more important than other
texts.
Physical tags are used to tell the browser how to display the text enclosed in
the physical tag. Some of the examples of physical tags are <b>, <big>, <i>.
مبروك
HTML انت الان انتهيت من كتاب تعلم
CSS سنبدأ الان في تعلم
وسم/tag قم بالبحث والتدريب علي بعض الاكواد لكي لا تنسي اي
43