diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/explore-differences-between-the-var-and-let-keywords.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/explore-differences-between-the-var-and-let-keywords.md index 7bf4dfaf770..38ee1bca4fb 100644 --- a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/explore-differences-between-the-var-and-let-keywords.md +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/explore-differences-between-the-var-and-let-keywords.md @@ -1,6 +1,6 @@ --- id: 587d7b87367417b2b2512b3f -title: استكشاف الاختلافات بين كلمتين var و let +title: استكشاف الاختلافات بين المصطلحين var و let challengeType: 1 forumTopicId: 301202 dashedName: explore-differences-between-the-var-and-let-keywords @@ -8,7 +8,7 @@ dashedName: explore-differences-between-the-var-and-let-keywords # --description-- -واحدة من أكبر المشكلات في إعلان المتغيرات بكلمة `var` هي أنه يمكنك بسهولة تغيير الإعلانات السابقة للمتغيرات: +واحدة من أكبر المشكلات في إعلان المتغيرات بكلمة `var` هي أنه يمكنك بسهولة إلغاء الإعلانات السابقة للمتغيرات: ```js var camper = "James"; @@ -16,9 +16,9 @@ var camper = "David"; console.log(camper); ``` -في الكود أعلاه، أعطي متغير `camper` قيمة `James` في الإعلان الأصلي، ثم ألغيَ عند إعادة إعلانه ليصبح `David`. ثم يعرض الكونسول (console) المقطع النصي (string) الآتي `David`. +في الكود أعلاه، أعطى متغير `camper` قيمة `James` في الإعلان الأصلي، ثم ألغيَ عند إعادة إعلانه ليصبح `David`. ولذلك يعرض الكونسول (console) المقطع النصي (string) الآتي `David`. -في تطبيق صغير، قد لا تواجه هذا النوع من المشاكل. لكن إذا أصبح الكود الخاص بك أكبر، قد تلغي متغير دون وعي. ولأن هذا السلوك لا يوقع خطأ، يصبح البحث عن الأخطاء وإصلاحها أكثر صعوبة. +في تطبيق صغير، قد لا تواجه هذه المشكلة. لكن إذا أصبح الكود الخاص بك أكبر، قد تلغي متغير دون وعي. ولأن هذا السلوك لا يوقع خطأ، يصبح البحث عن الأخطاء وإصلاحها أكثر صعوبة. تم تقديم كلمة `let` في ES6، وهو تحديث رئيسي في الجافاسكريبت (JavaScript)، لحل هذه المشكلة المحتملة باستخدام `var`. ستتعرف على ميزات ES6 الأخرى في التحديات اللاحقة. @@ -29,7 +29,7 @@ let camper = "James"; let camper = "David"; ``` -يمكن رؤية الخطأ في وحدة تحكم (console) المتصفح الخاص بك. +يمكن رؤية الخطأ في الكونسول (console) المتصفح الخاص بك. لذلك على خلاف `var`، عندما تستعمل `let`، يمكن إعلان متغير بنفس الاسم مرة واحدة فقط. @@ -45,13 +45,13 @@ let camper = "David"; assert.notMatch(code, /var/g); ``` -يجب أن تساوي `catName` المقطع النصي (string) الآتي `Oliver`. +يجب أن تساوي `catName` المقطع النصي الآتي `Oliver`. ```js assert.equal(catName, 'Oliver'); ``` -يجب أن تساوي `catSound` المقطع النصي (string) الآتي `Meow!` +يجب أن تساوي `catSound` المقطع النصي الآتي `Meow!` ```js assert.equal(catSound, 'Meow!'); diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/find-the-length-of-a-string.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/find-the-length-of-a-string.md index 3343589652f..b2faae6839a 100644 --- a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/find-the-length-of-a-string.md +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/find-the-length-of-a-string.md @@ -1,6 +1,6 @@ --- id: bd7123c9c448eddfaeb5bdef -title: العثور عن عدد الرموز في مقطع نصي +title: العثور عن عدد الرموز أو الطول لمقطع نصي challengeType: 1 videoUrl: 'https://scrimba.com/c/cvmqEAd' forumTopicId: 18182 @@ -9,7 +9,7 @@ dashedName: find-the-length-of-a-string # --description-- -يمكنك العثور على قيمة عدد الرموز في `String` بكتابة `.length` بعد متغير المقطع النصي أو بعد مقطع حرفي (string literal). +يمكنك العثور على الطول أو عدد الرموز في `String` بكتابة `.length` بعد متغير المقطع النصي أو بعد مقطع حرفي (string literal). ```js console.log("Alan Peter".length); diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-last-character-in-a-string.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-last-character-in-a-string.md index 9b2d370797c..229a4c6c1f3 100644 --- a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-last-character-in-a-string.md +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-last-character-in-a-string.md @@ -9,7 +9,7 @@ dashedName: use-bracket-notation-to-find-the-last-character-in-a-string # --description-- -للحصول على آخر حرف من سلسلة (String)، يمكنك طرح واحد من طول السلسلة (String). +للحصول على آخر حرف من المقطع النصي (String)، يمكنك طرح واحد من طوله. على سبيل المثال، إذا `const firstName = "Ada"`، يمكنك الحصول على قيمة الحرف الأخير من السلسلة باستخدام `firstName[firstName.length - 1]`. diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/remove-elements-from-an-array-using-slice-instead-of-splice.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/remove-elements-from-an-array-using-slice-instead-of-splice.md index 8c811a875a6..39f2c35a806 100644 --- a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/remove-elements-from-an-array-using-slice-instead-of-splice.md +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/remove-elements-from-an-array-using-slice-instead-of-splice.md @@ -21,7 +21,7 @@ cities.splice(3, 1); # --instructions-- -أعّد كتابة الوظيفة `nonMutatingSplice` باستخدام `slice` بدلاً من `splice`. يجب أن يقصر طول مصفوفة `cities` المقدمة على 3، ويعيد array جديدة تحتوي على العناصر الثلاثة الأولى فقط. +أعّد كتابة الوظيفة `nonMutatingSplice` باستخدام `slice` بدلاً من `splice`. يجب أن يقصر طول القائمة `cities` المقدمة على 3، ويعيد array جديدة تحتوي على العناصر الثلاثة الأولى فقط. لا تغيّر القائمة (array) الأصلية المقدمة للوظيفة (function). diff --git a/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/elements-and-tags-question-a.md b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/elements-and-tags-question-a.md new file mode 100644 index 00000000000..f4b05b12871 --- /dev/null +++ b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/elements-and-tags-question-a.md @@ -0,0 +1,54 @@ +--- +id: 637f4e0e72c65bc8e73dfe1e +videoId: LGQuIIv2RVA +title: Elements and Tags Question A +challengeType: 15 +dashedName: elements-and-tags-question-a +--- + +# --description-- + +Almost all elements on an HTML page are just pieces of content wrapped in opening and closing HTML tags. + +Opening tags tell the browser this is the start of an HTML element. They are comprised of a keyword enclosed in angle brackets `<>`. For example, an opening paragraph tag looks like this: `

`. + +Closing tags tell the browser where an element ends. They are almost the same as opening tags; the only difference is that they have a forward slash before the keyword. For example, a closing paragraph tag looks like this: `

`. + +A full paragraph element looks like this: + +element diagram + +You can think of elements as containers for content. The opening and closing tags tell the browser what content the element contains. The browser can then use that information to determine how it should interpret and format the content. + +There are some HTML elements that do not have a closing tag. These elements often look like this: `
` or ``, but some can also be used without the closing forward slash such as `
` or ``. These are known as self-closing tags or empty elements because they don’t wrap any content. You will encounter a few of these in later lessons, but for the most part, elements will have both opening and closing tags. + +HTML has a vast list of predefined tags that you can use to create all kinds of different elements. It is important to use the correct tags for content. Using the correct tags can have a big impact on two aspects of your sites: how they are ranked in search engines; and how accessible they are to users who rely on assistive technologies, like screen readers, to use the internet. + +Using the correct elements for content is called semantic HTML. You will explore this in much more depth later on in the curriculum. + +# --question-- + +## --assignment-- + +Watch Kevin Powell’s [Introduction to HTML video](https://www.youtube.com/watch?v=LGQuIIv2RVA&list=PL4-IK0AVhVjM0xE0K2uZRvsM7LkIhsPT-) + +## --text-- + +What are HTML tags? + +## --answers-- + +HTML tags tell the browser what content an element contains. + +--- + +HTML tags tell the browser when to load its content. + +--- + +HTML tags tell the browser what content the next element contains. + + +## --video-solution-- + +1 diff --git a/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/elements-and-tags-question-b.md b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/elements-and-tags-question-b.md new file mode 100644 index 00000000000..9e8720616fb --- /dev/null +++ b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/elements-and-tags-question-b.md @@ -0,0 +1,50 @@ +--- +id: 637f4e1672c65bc8e73dfe1f +videoId: LGQuIIv2RVA +title: Elements and Tags Question B +challengeType: 15 +dashedName: elements-and-tags-question-b +--- + +# --description-- + +Almost all elements on an HTML page are just pieces of content wrapped in opening and closing HTML tags. + +Opening tags tell the browser this is the start of an HTML element. They are comprised of a keyword enclosed in angle brackets <>. For example, an opening paragraph tag looks like this: `

`. + +Closing tags tell the browser where an element ends. They are almost the same as opening tags; the only difference is that they have a forward slash before the keyword. For example, a closing paragraph tag looks like this: `

`. + +A full paragraph element looks like this: + +element diagram + +You can think of elements as containers for content. The opening and closing tags tell the browser what content the element contains. The browser can then use that information to determine how it should interpret and format the content. + +There are some HTML elements that do not have a closing tag. These elements often look like this: `
` or ``, but some can also be used without the closing forward slash such as `
` or ``. These are known as self-closing tags or empty elements because they don’t wrap any content. You will encounter a few of these in later lessons, but for the most part, elements will have both opening and closing tags. + +HTML has a vast list of predefined tags that you can use to create all kinds of different elements. It is important to use the correct tags for content. Using the correct tags can have a big impact on two aspects of your sites: how they are ranked in search engines; and how accessible they are to users who rely on assistive technologies, like screen readers, to use the internet. + +Using the correct elements for content is called semantic HTML. You will explore this in much more depth later on in the curriculum. + +# --question-- + +## --text-- + +What are the three parts of most HTML elements? + +## --answers-- + +An opening tag, self closing tag, and content. + +--- + +An opening tag, closing tag, and content. + +--- + +An opening tag, closing tag, and attribute. + + +## --video-solution-- + +2 diff --git a/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/html-boilerplate-question-a.md b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/html-boilerplate-question-a.md new file mode 100644 index 00000000000..d563ebf0ac3 --- /dev/null +++ b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/html-boilerplate-question-a.md @@ -0,0 +1,55 @@ +--- +id: 637f4e1c72c65bc8e73dfe20 +videoId: V8UAEoOvqFg +title: HTML Boilerplate Question A +challengeType: 15 +dashedName: html-boilerplate-question-a +--- + +# --description-- + +To demonstrate an HTML boilerplate, you first need an HTML file to work with. + +Create a new folder on your computer and name it `html-boilerplate`. Within that folder create a new file and name it `index.html`. + +You’re probably already familiar with a lot of different types of files, for example doc, pdf, and image files. + +To let the computer know you want to create an HTML file, you need to append the filename with the `.html` extension as you have done when creating the `index.html` file. + +It is worth noting that you named your HTML file index. You should always name the HTML file that will contain the homepage of your websites `index.html`. This is because web servers will by default look for an index.html page when users land on your websites - and not having one will cause big problems. + +## The DOCTYPE + +Every HTML page starts with a doctype declaration. The doctype’s purpose is to tell the browser what version of HTML it should use to render the document. The latest version of HTML is HTML5, and the doctype for that version is simply ``. + +The doctypes for older versions of HTML were a bit more complicated. For example, this is the doctype declaration for HTML4: + +```html + +``` + +However, you probably won’t ever want to be using an older version of HTML, and so you’ll always use ``. + +Open the `index.html` file created earlier in your text editor and add `` to the very first line. + +# --question-- +## --text-- + +What is the purpose of the `DOCTYPE` declaration? + +## --answers-- + +It tells the browser which version of HTML to use to render the document. + +--- + +It tells the browser that this document uses JavaScript. + +--- + +It tells the browser the title of the document. + + +## --video-solution-- + +1 diff --git a/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/html-boilerplate-question-b.md b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/html-boilerplate-question-b.md new file mode 100644 index 00000000000..7a528432239 --- /dev/null +++ b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/html-boilerplate-question-b.md @@ -0,0 +1,47 @@ +--- +id: 637f4e2872c65bc8e73dfe21 +videoId: V8UAEoOvqFg +title: HTML Boilerplate Question B +challengeType: 15 +dashedName: html-boilerplate-question-b +--- + +# --description-- + +After you declare the doctype, you need to provide an `` element. This is what’s known as the root element of the document, meaning that every other element in the document will be a descendant of it. + +This becomes more important later on when you learn about manipulating HTML with JavaScript. For now, just know that the `html` element should be included on every HTML document. + +Back in the `index.html` file, let’s add the `` element by typing out its opening and closing tags, like so: + +```html + + + +``` + +## What is the lang attribute? +`lang` specifies the language of the text content in that element. This attribute is primarily used for improving accessibility of the webpage. It allows assistive technologies, for example screen readers, to adapt according to the language and invoke correct pronunciation. + +# --question-- + +## --text-- + +What is the `html` element? + +## --answers-- + +It is the root element in the document and tells the browser which version of HTML it should use. + +--- + +It is the root element in the document and all other elements should descend from it. + +--- + +It is the root element in the document and all other elements should come after it. + + +## --video-solution-- + +2 diff --git a/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/html-boilerplate-question-c.md b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/html-boilerplate-question-c.md new file mode 100644 index 00000000000..76ceb2841e5 --- /dev/null +++ b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/html-boilerplate-question-c.md @@ -0,0 +1,66 @@ +--- +id: 637f4e2f72c65bc8e73dfe22 +videoId: LGQuIIv2RVA +title: HTML Boilerplate Question C +challengeType: 15 +dashedName: html-boilerplate-question-c +--- + +# --description-- + +The `` element is where you put important meta-information about your webpages, and stuff required for your webpages to render correctly in the browser. Inside the ``, you should not use any element that displays content on the webpage. + +## The Charset Meta Element +You should always have the `meta` tag for the charset encoding of the webpage in the head element: ``. + +Setting the encoding is very important because it ensures that the webpage will display special symbols and characters from different languages correctly in the browser. + +## Title Element +Another element you should always include in the head of an HTML document is the `title` element: + +```html +My First Webpage +``` + +The `title` element is used to give webpages a human-readable title which is displayed in your webpage’s browser tab. + +If you didn’t include a `title` element, the webpage’s title would default to its file name. In your case that would be `index.html`, which isn’t very meaningful for users; this would make it very difficult to find your webpage if the user has many browser tabs open. + +There are many more elements that can go within the `head` of an HTML document. However, for now it’s only crucial to know about the two elements you have covered here. You will introduce more elements that go into the `head` throughout the rest of the curriculum. + +Back in `index.html` file, let’s add a `head` element with a `charset` `meta` element and a `title` within it. The head element goes within the HTML element and should always be the first element under the opening `` tag: + + +```html + + + + + + My First Webpage + + +``` + +# --question-- + +## --text-- + +What is the purpose of the `head` element? + +## --answers-- + +The `head` element is used to display all elements that are displayed on the webpage. + +--- + +The `head` element is used to display important information about your webpage and is used to render web pages correctly with `meta` elements. + +--- + +The `head` element is used to display the header content on top of the webpage. + + +## --video-solution-- + +2 diff --git a/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/html-boilerplate-question-d.md b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/html-boilerplate-question-d.md new file mode 100644 index 00000000000..302b6a95d44 --- /dev/null +++ b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/html-boilerplate-question-d.md @@ -0,0 +1,48 @@ +--- +id: 637f4e3672c65bc8e73dfe23 +videoId: V8UAEoOvqFg +title: HTML Boilerplate Question D +challengeType: 15 +dashedName: html-boilerplate-question-d +--- + +# --description-- + +The final element needed to complete the HTML boilerplate is the `` element. This is where all the content that will be displayed to users will go - the text, images, lists, links, and so on. + +To complete the boilerplate, add a `body` element to the `index.html` file. The `body` element also goes within the `html` element and is always below the `head` element, like so: + +# --question-- + +## --assignment-- + +Watch and follow along to Kevin Powell’s brilliant Building your first web page video above. + +--- + +Build some muscle memory by deleting the contents of the `index.html` file and trying to write out all the boilerplate again from memory. Don’t worry if you have to peek at the lesson content the first few times if you get stuck. Just keep going until you can do it a couple of times from memory. + +--- + +Run your boilerplate through this [HTML validator](https://www.freeformatter.com/html-validator.html). Validators ensure your markup is correct and are an excellent learning tool, as they provide feedback on syntax errors you may be making often and aren’t aware of, such as missing closing tags and extra spaces in your HTML. + +## --text-- + +What is the purpose of the `body` element? + +## --answers-- + +This is where all important information about the webpage is displayed such as the `title` and `meta` tags. + +--- + +This is where you tell the browser how to render the webpage correctly. + +--- + +This is where all content will be displayed on the page such images, text, and links. + + +## --video-solution-- + +3 diff --git a/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/introduction-to-html-css-question-a.md b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/introduction-to-html-css-question-a.md new file mode 100644 index 00000000000..aa20f137e89 --- /dev/null +++ b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/introduction-to-html-css-question-a.md @@ -0,0 +1,42 @@ +--- +id: 6374f208de18c50e48ba767b +videoId: LGQuIIv2RVA +title: Introduction To HTML and CSS Question A +challengeType: 15 +dashedName: introduction-to-html-and-css-question-a +--- + +# --description-- + +HTML and CSS are two languages that work together to create everything that you see when you look at something on the internet. HTML is the raw data that a webpage is built out of. All the text, links, cards, lists, and buttons are created in HTML. CSS is what adds style to those plain elements. HTML puts information on a webpage, and CSS positions that information, gives it color, changes the font, and makes it look great! + +Many helpful resources out there keep referring to HTML and CSS as programming languages, but if you want to get technical, labeling them as such is not quite accurate. This is because they are only concerned with presenting information. They are not used to program logic. JavaScript, which you will learn in the next section, is a programming language because it’s used to make webpages do things. Yet, there is quite a lot you can do with just HTML and CSS, and you will definitely need them both. Throughout our curriculum, the following lessons focus on giving you the tools you need to succeed once you reach JavaScript content. + +# --question-- + +## --assignment-- + +Read the HTML vs CSS vs JavaScript article. It is a quick overview of the relationships between HTML, CSS, and JavaScript. + +## --text-- + +Which of the following statements is true? + +## --answers-- + +CSS is used to create the basic structure of a webpage, and HTML is used to add style. + +--- + +HTML is used to create the basic structure of a webpage, and CSS is used to add style. + +--- + +HTML and CSS are used to add style to a webpage, and JavaScript is used to create the basic structure. + + +## --video-solution-- + +2 + + diff --git a/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/introduction-to-html-css-question-b.md b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/introduction-to-html-css-question-b.md new file mode 100644 index 00000000000..cd9cf900330 --- /dev/null +++ b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/introduction-to-html-css-question-b.md @@ -0,0 +1,37 @@ +--- +id: 6376327e2724a688c04636e3 +videoId: LGQuIIv2RVA +title: Introduction To HTML and CSS Question B +challengeType: 15 +dashedName: introduction-to-html-and-css-question-b +--- + +# --description-- + + +HTML and CSS are two languages that work together to create everything that you see when you look at something on the internet. HTML is the raw data that a webpage is built out of. All the text, links, cards, lists, and buttons are created in HTML. CSS is what adds style to those plain elements. HTML puts information on a webpage, and CSS positions that information, gives it color, changes the font, and makes it look great! + +Many helpful resources out there keep referring to HTML and CSS as programming languages, but if you want to get technical, labeling them as such is not quite accurate. This is because they are only concerned with presenting information. They are not used to program logic. JavaScript, which you will learn in the next section, is a programming language because it’s used to make webpages do things. Yet, there is quite a lot you can do with just HTML and CSS, and you will definitely need them both. Throughout our curriculum, the following lessons focus on giving you the tools you need to succeed once you reach JavaScript content. + +# --question-- + +## --text-- + +Between HTML and CSS, which should you use to add paragraphs of text on a webpage? + +## --answers-- + +CSS + +--- + +JavaScript + +--- + +HTML + + +## --video-solution-- + +3 diff --git a/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/introduction-to-html-css-question-c.md b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/introduction-to-html-css-question-c.md new file mode 100644 index 00000000000..eb759394680 --- /dev/null +++ b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/introduction-to-html-css-question-c.md @@ -0,0 +1,34 @@ +--- +id: 637633162724a688c04636e4 +videoId: LGQuIIv2RVA +title: Introduction To HTML and CSS Question C +challengeType: 15 +dashedName: introduction-to-html-and-css-question-c +--- + +# --description-- + +HTML and CSS are two languages that work together to create everything that you see when you look at something on the internet. HTML is the raw data that a webpage is built out of. All the text, links, cards, lists, and buttons are created in HTML. CSS is what adds style to those plain elements. HTML puts information on a webpage, and CSS positions that information, gives it color, changes the font, and makes it look great! + +Many helpful resources out there keep referring to HTML and CSS as programming languages, but if you want to get technical, labeling them as such is not quite accurate. This is because they are only concerned with presenting information. They are not used to program logic. JavaScript, which you will learn in the next section, is a programming language because it’s used to make webpages do things. Yet, there is quite a lot you can do with just HTML and CSS, and you will definitely need them both. Throughout our curriculum, the following lessons focus on giving you the tools you need to succeed once you reach JavaScript content. +# --question-- + +## --text-- + +Between HTML and CSS, which should you use to change the font and background color of a button? + +## --answers-- + +You should use CSS to change the background color and font of a button. + +--- + +You should use JavaScript to change the background color and font of a button. + +--- + +You should use HTML to change the background color and font of a button. + +## --video-solution-- + +1 diff --git a/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/introduction-to-html-css-question-d.md b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/introduction-to-html-css-question-d.md new file mode 100644 index 00000000000..9e9ee049b75 --- /dev/null +++ b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/introduction-to-html-css-question-d.md @@ -0,0 +1,35 @@ +--- +id: 637633672724a688c04636e5 +videoId: LGQuIIv2RVA +title: Introduction To HTML and CSS Question D +challengeType: 15 +dashedName: introduction-to-html-and-css-question-d +--- + +# --description-- + +HTML and CSS are two languages that work together to create everything that you see when you look at something on the internet. HTML is the raw data that a webpage is built out of. All the text, links, cards, lists, and buttons are created in HTML. CSS is what adds style to those plain elements. HTML puts information on a webpage, and CSS positions that information, gives it color, changes the font, and makes it look great! + +Many helpful resources out there keep referring to HTML and CSS as programming languages, but if you want to get technical, labeling them as such is not quite accurate. This is because they are only concerned with presenting information. They are not used to program logic. JavaScript, which you will learn in the next section, is a programming language because it’s used to make webpages do things. Yet, there is quite a lot you can do with just HTML and CSS, and you will definitely need them both. Throughout our curriculum, the following lessons focus on giving you the tools you need to succeed once you reach JavaScript content. + +# --question-- + +## --text-- + +What is the difference between HTML, CSS, and JavaScript? + +## --answers-- + +HTML is for creating interactive elements, CSS is for the look and feel, and JavaScript is for creating the structure of a webpage. + +--- + +CSS is for the look and feel, JavaScript is for creating interactive elements, and HTML is for creating the structure of a webpage. + +--- + +JavaScript is for the look and feel, CSS is for creating the structure, and HTML is for creating interactive elements of a webpage. + +## --video-solution-- + +2 diff --git a/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/links-and-images-question-a.md b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/links-and-images-question-a.md new file mode 100644 index 00000000000..b4d237448f3 --- /dev/null +++ b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/links-and-images-question-a.md @@ -0,0 +1,66 @@ +--- +id: 637f704072c65bc8e73dfe36 +videoId: tsEQgGjSmkM +title: Links and Images Question A +challengeType: 15 +dashedName: links-and-images-question-a +--- + +# --description-- + +To get some practice using links and images throughout this lesson you need an HTML project to work with. + +- Create a new directory named `odin-links-and-images`. + +- Within that directory, create a new file named `index.html`. + +- Fill in the usual HTML boilerplate. + +- Finally, add the following `h1` to the `body`: `

Homepage

` + +## Anchor Elements +To create a link in HTML, you use the anchor element. An anchor element is defined by wrapping the text or another HTML element you want to be a link with an `` tag. Add the following to the `body` of the `index.html` page you created and open it in the browser: + +```html +click me +``` + +You may have noticed that clicking this link doesn’t do anything. This is because an anchor tag on its own won’t know where you want to link to. You have to tell it a destination to go to. You do this by using an HTML attribute. + +An HTML attribute gives additional information to an HTML element and always goes in the element’s opening tag. An attribute is usually made up of two parts: a name, and a value; however, not all attributes require a value. In your case, you need to add a `href` (hyperlink reference) attribute to the opening anchor tag. The value of the `href` attribute is the destination you want your link to go to. + +Add the following `href` attribute to the anchor element you created previously and try clicking it again, don’t forget to refresh the browser so the new changes can be applied. + +```html +click me +``` + +By default, any text wrapped with an anchor tag without a `href` attribute will look like plain text. If the `href` attribute is present, the browser will give the text a blue color and underline it to signify it is a link. + +It’s worth noting you can use anchor tags to link to any kind of resource on the internet, not just other HTML documents. You can link to videos, pdf files, images, and so on, but for the most part, you will be linking to other HTML documents. + +# --question-- + +## --assignment-- + +Watch Kevin Powell’s HTML Links video above. + +## --text-- + +What HTML tag is used to create a link? + +## --answers-- + +`` + +--- + +`

` + +--- + +`

    ` + +## --video-solution-- + +1 diff --git a/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/links-and-images-question-b.md b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/links-and-images-question-b.md new file mode 100644 index 00000000000..164fb01214f --- /dev/null +++ b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/links-and-images-question-b.md @@ -0,0 +1,55 @@ +--- +id: 637f703572c65bc8e73dfe35 +videoId: tsEQgGjSmkM +title: Links and Images Question B +challengeType: 15 +dashedName: links-and-images-question-b +--- + +# --description-- + +To get some practice using links and images throughout this lesson you need an HTML project to work with. + +- Create a new directory named odin-links-and-images. + +- Within that directory, create a new file named index.html. + +- Fill in the usual HTML boilerplate. + +- finally, add the following h1 to the body: `

    Homepage

    ` + +## Anchor Elements +To create a link in HTML, you use the anchor element. An anchor element is defined by wrapping the text or another HTML element you want to be a link with an `
    ` tag. Add the following to the body of the index.html page you created and open it in the browser: + +```html +click me +``` + +You may have noticed that clicking this link doesn’t do anything. This is because an anchor tag on its own won’t know where you want to link to. You have to tell it a destination to go to. You do this by using an HTML attribute. An HTML attribute gives additional information to an HTML element and always goes in the element’s opening tag. An attribute is usually made up of two parts: a name, and a value; however, not all attributes require a value. In your case, you need to add a href (hyperlink reference) attribute to the opening anchor tag. The value of the href attribute is the destination you want your link to go to. Add the following href attribute to the anchor element you created previously and try clicking it again, don’t forget to refresh the browser so the new changes can be applied. + +```html +click me +``` + +By default, any text wrapped with an anchor tag without a `href` attribute will look like plain text. If the `href` attribute is present, the browser will give the text a blue color and underline it to signify it is a link. It’s worth noting you can use anchor tags to link to any kind of resource on the internet, not just other HTML documents. You can link to videos, pdf files, images, and so on, but for the most part, you will be linking to other HTML documents. + +# --question-- +## --text-- + +What is an attribute? +## --answers-- + +An HTML attribute gives additional information to an HTML element and always goes in the element’s closing tag. + +--- + +An HTML attribute is used to tell the browser what the element contains. + +--- + +An HTML attribute gives additional information to an HTML element and always goes in the element’s opening tag. + + +## --video-solution-- + +3 diff --git a/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/links-and-images-question-c.md b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/links-and-images-question-c.md new file mode 100644 index 00000000000..c8a3913d77e --- /dev/null +++ b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/links-and-images-question-c.md @@ -0,0 +1,56 @@ +--- +id: 637f703072c65bc8e73dfe34 +videoId: tsEQgGjSmkM +title: Links and Images Question C +challengeType: 15 +dashedName: links-and-images-question-c +--- + +# --description-- + +To get some practice using links and images throughout this lesson you need an HTML project to work with. + +- Create a new directory named odin-links-and-images. + +- Within that directory, create a new file named index.html. + +- Fill in the usual HTML boilerplate. + +- finally, add the following h1 to the body: `

    Homepage

    ` + +## Anchor Elements +To create a link in HTML, you use the anchor element. An anchor element is defined by wrapping the text or another HTML element you want to be a link with an `` tag. Add the following to the body of the index.html page you created and open it in the browser: + +```html +click me +``` + +You may have noticed that clicking this link doesn’t do anything. This is because an anchor tag on its own won’t know where you want to link to. You have to tell it a destination to go to. You do this by using an HTML attribute. An HTML attribute gives additional information to an HTML element and always goes in the element’s opening tag. An attribute is usually made up of two parts: a name, and a value; however, not all attributes require a value. In your case, you need to add a href (hyperlink reference) attribute to the opening anchor tag. The value of the href attribute is the destination you want your link to go to. Add the following href attribute to the anchor element you created previously and try clicking it again, don’t forget to refresh the browser so the new changes can be applied. + +```html +click me +``` + +By default, any text wrapped with an anchor tag without a `href` attribute will look like plain text. If the `href` attribute is present, the browser will give the text a blue color and underline it to signify it is a link. It’s worth noting you can use anchor tags to link to any kind of resource on the internet, not just other HTML documents. You can link to videos, pdf files, images, and so on, but for the most part, you will be linking to other HTML documents. + +# --question-- + +## --text-- + +What attribute tells links where to go to? + +## --answers-- + +`src` + +--- + +`href` + +--- + +`link` + +## --video-solution-- + +2 diff --git a/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/links-and-images-question-d.md b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/links-and-images-question-d.md new file mode 100644 index 00000000000..2b6a665eb87 --- /dev/null +++ b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/links-and-images-question-d.md @@ -0,0 +1,112 @@ +--- +id: 637f702872c65bc8e73dfe33 +videoId: ta3Oxx7Yqbo +title: Links and Images Question D +challengeType: 15 +dashedName: links-and-images-question-d +--- + +# --description-- + + +Generally, there are two kinds of links you will create: + +- Links to pages on other websites on the internet + +- Links to pages located on your own websites + + +## Absolute Links +Links to pages on other websites on the internet are called absolute links. A typical absolute link will be made up of the following parts: `protocol://domain/path`. An absolute link will always contain the protocol and domain of the destination. + +You’ve already seen an absolute link in action. The link you created to The Odin Project’s About page earlier was an absolute link as it contains the protocol and domain. + +`https://www.theodinproject.com/about` + +## Relative Links +Links to other pages within your own website are called relative links. Relative links do not include the domain name, since it is another page on the same site, it assumes the domain name will be the same as the page you created the link on. + +Relative links only include the file path to the other page, relative to the page you are creating the link on. This is quite abstract, let’s see this in action using an example. + +Within the `odin-links-and-images` directory, create another HTML file named `about.html` and paste the following code into it: + +```html + + + + + Odin Links and Images + + + +

    About Page

    + + +``` + +Back in the index page, add the following anchor element to create a link to the about page: + +```html + +

    Homepage

    + click me + + About + +``` + +Open the index file in a browser and click on the about link to make sure it is all wired together correctly. Clicking the link should go to the about page you just created. + +This works because the index and about page are in the same directory. That means you can simply use its name (`about.html`) as the link’s href value. + +But you will usually want to organize your website directories a little better. Normally you would only have the `index.html` at the root directory and all other HTML files in their own directory. + +Create a directory named `pages` within the `odin-links-and-images` directory and move the `about.html` file into this new directory. + +Refresh the index page in the browser and then click on the about link. It will now be broken. This is because the location of the about page file has changed. + +To fix this, you just need to update the about link `href` value to include the `pages/` directory since that is the new location of the about file relative to the index file. + +```html + +

    Homepage

    + About + +``` + +Refresh the index page in the browser and try clicking the about link again, it should now be back in working order. + +In many cases, this will work just fine; however, you can still run into unexpected issues with this approach. Prepending `./` before the link will in most cases prevent such issues. By adding `./` you are specifying to your code that it should start looking for the file/directory relative to the **current** directory. + +```html + +

    Homepage

    + About + +``` + +# --question-- + +## --assignment-- + +Watch Kevin Powell’s HTML File Structure video above. + +## --text-- + +What is the difference between an absolute and a relative link? + +## --answers-- + +An absolute link is a link to another page on the current website. A relative link is a link to another website. + +--- + +An absolute link is a link to another website. A relative link is a link another page on the current website. + +--- + +There is no difference between absolute and relative links. + +## --video-solution-- + +2 diff --git a/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/links-and-images-question-e.md b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/links-and-images-question-e.md new file mode 100644 index 00000000000..a935ae3262a --- /dev/null +++ b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/links-and-images-question-e.md @@ -0,0 +1,98 @@ +--- +id: 637f702372c65bc8e73dfe32 +videoId: 0xoztJCHpbQ +title: Links and Images Question E +challengeType: 15 +dashedName: links-and-images-question-e +--- + +# --description-- + +Websites would be fairly boring if they could only display text. Luckily HTML provides a wide variety of elements for displaying all sorts of different media. The most widely used of these is the image element. + +To display an image in HTML you use the `` element. Unlike the other elements you have encountered, the `` element is self-closing. Empty, self-closing HTML elements do not need a closing tag. + +Instead of wrapping content with an opening and closing tag, it embeds an image into the page using a `src` attribute which tells the browser where the image file is located. The `src` attribute works much like the `href` attribute for anchor tags. It can embed an image using both absolute and relative paths. + +For example, using an absolute path you can display an image located on The Odin Project site: + + + +To use images that you have on your own websites, you can use a relative path. + +- Create a new directory named `images` within the `odin-links-and-images` project. + +- Next, download [this image](https://unsplash.com/photos/Mv9hjnEUHR4/download?force=true&w=640) and move it into the `images` directory you just created. + +- Rename the image to `dog.jpg`. + +Finally add the image to the `index.html` file: + +```html + +

    Homepage

    + click me + + About + + + +``` + +Save the `index.html` file and open it in a browser to view Charles in all his glory. + + +## Parent Directories + +What if you want to use the dog image in the about page? You would first have to go up one level out of the pages directory into its parent directory so you could then access the images directory. + +To go to the parent directory you need to use two dots in the relative filepath like this: `../.` Let’s see this in action, within the body of the `about.html` file, add the following image below the heading you added earlier: + +```html + +``` + +To break this down: + +- First, you are going to the parent directory of the pages directory which is `odin-links-and-images`. + +- Then, from the parent directory, you can go into the `images` directory. + +- Finally, you can access the `dog.jpg` file. + +Using the metaphor we used earlier, using `../` in a filepath is kind of like stepping out from the room you are currently in to the main hallway so you can go to another room. + +## `Alt` attribute + +Besides the `src` attribute, every image element should also have an `alt` (alternative text) attribute. + +The `alt` attribute is used to describe an image. It will be used in place of the image if it cannot be loaded. It is also used with screen readers to describe what the image is to visually impaired users. + +This is how the The Odin Project logo example you used earlier looks with an `alt` attribute included: + + +# --question-- + +## --assignment-- + +Watch Kevin Powell’s HTML Images Video above. + +## --text-- + +Which tag is used to display an image? + +## --answers-- + +`` + +--- + +`` + +--- + +`` + +## --video-solution-- + +3 diff --git a/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/links-and-images-question-f.md b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/links-and-images-question-f.md new file mode 100644 index 00000000000..ba4eb809e5d --- /dev/null +++ b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/links-and-images-question-f.md @@ -0,0 +1,94 @@ +--- +id: 637f701c72c65bc8e73dfe31 +videoId: 0xoztJCHpbQ +title: Links and Images Question F +challengeType: 15 +dashedName: links-and-images-question-f +--- + +# --description-- + +Websites would be fairly boring if they could only display text. Luckily HTML provides a wide variety of elements for displaying all sorts of different media. The most widely used of these is the image element. + +To display an image in HTML you use the `` element. Unlike the other elements you have encountered, the `` element is self-closing. Empty, self-closing HTML elements do not need a closing tag. + +Instead of wrapping content with an opening and closing tag, it embeds an image into the page using a src attribute which tells the browser where the image file is located. The src attribute works much like the href attribute for anchor tags. It can embed an image using both absolute and relative paths. + +For example, using an absolute path you can display an image located on The Odin Project site: + + + +To use images that you have on your own websites, you can use a relative path. + +- Create a new directory named `images` within the `odin-links-and-images` project. + +- Next, download [this image](https://unsplash.com/photos/Mv9hjnEUHR4/download?force=true&w=640) and move it into the images directory you just created. + +- Rename the image to `dog.jpg`. + +Finally add the image to the `index.html` file: + +```html + +

    Homepage

    +
    click me + + About + + + +``` + +Save the `index.html` file and open it in a browser to view Charles in all his glory. + + +## Parent Directories + +What if you want to use the dog image in the about page? You would first have to go up one level out of the pages directory into its parent directory so you could then access the images directory. + +To go to the parent directory you need to use two dots in the relative filepath like this: `../.` Let’s see this in action, within the body of the `about.html` file, add the following image below the heading you added earlier: + +```html + +``` + +To break this down: + +- First, you are going to the parent directory of the pages directory which is `odin-links-and-images`. + +- Then, from the parent directory, you can go into the `images` directory. + +- Finally, you can access the `dog.jpg` file. + +Using the metaphor we used earlier, using `../` in a filepath is kind of like stepping out from the room you are currently in to the main hallway so you can go to another room. + +## Alt attribute + +Besides the src attribute, every image element should also have an alt (alternative text) attribute. + +The alt attribute is used to describe an image. It will be used in place of the image if it cannot be loaded. It is also used with screen readers to describe what the image is to visually impaired users. + +This is how the The Odin Project logo example you used earlier looks with an alt attribute included: + + +# --question-- + +## --text-- + +What two attributes do images always need to have? + +## --answers-- + +`href` and `alt` + +--- + +`name` and `href` + +--- + +`alt` and `src` + +## --video-solution-- + +3 diff --git a/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/links-and-images-question-g.md b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/links-and-images-question-g.md new file mode 100644 index 00000000000..d1a6fcd4406 --- /dev/null +++ b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/links-and-images-question-g.md @@ -0,0 +1,94 @@ +--- +id: 637f701572c65bc8e73dfe30 +videoId: 0xoztJCHpbQ +title: Links and Images Question G +challengeType: 15 +dashedName: links-and-images-question-g +--- + +# --description-- + +Websites would be fairly boring if they could only display text. Luckily HTML provides a wide variety of elements for displaying all sorts of different media. The most widely used of these is the image element. + +To display an image in HTML you use the `` element. Unlike the other elements you have encountered, the `` element is self-closing. Empty, self-closing HTML elements do not need a closing tag. + +Instead of wrapping content with an opening and closing tag, it embeds an image into the page using a src attribute which tells the browser where the image file is located. The src attribute works much like the href attribute for anchor tags. It can embed an image using both absolute and relative paths. + +For example, using an absolute path you can display an image located on The Odin Project site: + + + +To use images that you have on your own websites, you can use a relative path. + +- Create a new directory named `images` within the `odin-links-and-images` project. + +- Next, download [this image](https://unsplash.com/photos/Mv9hjnEUHR4/download?force=true&w=640) and move it into the images directory you just created. + +- Rename the image to `dog.jpg`. + +Finally add the image to the `index.html` file: + +```html + +

    Homepage

    + click me + + About + + + +``` + +Save the `index.html` file and open it in a browser to view Charles in all his glory. + + +## Parent Directories + +What if you want to use the dog image in the about page? You would first have to go up one level out of the pages directory into its parent directory so you could then access the images directory. + +To go to the parent directory you need to use two dots in the relative filepath like this: `../.` Let’s see this in action, within the body of the `about.html` file, add the following image below the heading you added earlier: + +```html + +``` + +To break this down: + +- First, you are going to the parent directory of the pages directory which is `odin-links-and-images`. + +- Then, from the parent directory, you can go into the `images` directory. + +- Finally, you can access the `dog.jpg` file. + +Using the metaphor we used earlier, using `../` in a filepath is kind of like stepping out from the room you are currently in to the main hallway so you can go to another room. + +## Alt attribute + +Besides the src attribute, every image element should also have an alt (alternative text) attribute. + +The alt attribute is used to describe an image. It will be used in place of the image if it cannot be loaded. It is also used with screen readers to describe what the image is to visually impaired users. + +This is how the The Odin Project logo example you used earlier looks with an alt attribute included: + + +# --question-- + +## --text-- + +How do you access a parent directory in a filepath? + +## --answers-- + +`../` + +--- + +`./` + +--- + +`.../` + +## --video-solution-- + +1 diff --git a/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/links-and-images-question-h.md b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/links-and-images-question-h.md new file mode 100644 index 00000000000..cfd73fcfbc1 --- /dev/null +++ b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/links-and-images-question-h.md @@ -0,0 +1,98 @@ +--- +id: 637f700b72c65bc8e73dfe2f +videoId: 0xoztJCHpbQ +title: Links and Images Question H +challengeType: 15 +dashedName: links-and-images-question-h +--- + +# --description-- + +Websites would be fairly boring if they could only display text. Luckily HTML provides a wide variety of elements for displaying all sorts of different media. The most widely used of these is the image element. + +To display an image in HTML you use the `` element. Unlike the other elements you have encountered, the `` element is self-closing. Empty, self-closing HTML elements do not need a closing tag. + +Instead of wrapping content with an opening and closing tag, it embeds an image into the page using a src attribute which tells the browser where the image file is located. The src attribute works much like the href attribute for anchor tags. It can embed an image using both absolute and relative paths. + +For example, using an absolute path you can display an image located on The Odin Project site: + + + +To use images that you have on your own websites, you can use a relative path. + +- Create a new directory named `images` within the `odin-links-and-images` project. + +- Next, download [this image](https://unsplash.com/photos/Mv9hjnEUHR4/download?force=true&w=640) and move it into the images directory you just created. + +- Rename the image to `dog.jpg`. + +Finally add the image to the `index.html` file: + +```html + +

    Homepage

    + click me + + About + + + +``` + +Save the `index.html` file and open it in a browser to view Charles in all his glory. + + +## Parent Directories + +What if you want to use the dog image in the about page? You would first have to go up one level out of the pages directory into its parent directory so you could then access the images directory. + +To go to the parent directory you need to use two dots in the relative filepath like this: `../.` Let’s see this in action, within the body of the `about.html` file, add the following image below the heading you added earlier: + +```html + +``` + +To break this down: + +- First, you are going to the parent directory of the pages directory which is `odin-links-and-images`. + +- Then, from the parent directory, you can go into the `images` directory. + +- Finally, you can access the `dog.jpg` file. + +Using the metaphor we used earlier, using `../` in a filepath is kind of like stepping out from the room you are currently in to the main hallway so you can go to another room. + +## Alt attribute + +Besides the src attribute, every image element should also have an alt (alternative text) attribute. + +The alt attribute is used to describe an image. It will be used in place of the image if it cannot be loaded. It is also used with screen readers to describe what the image is to visually impaired users. + +This is how the The Odin Project logo example you used earlier looks with an alt attribute included: + + +# --question-- + +## --assignment-- + +Read about the four main image formats that can be used on the web. + +## --text-- + +What are the four main image formats that you can use for images on the web? + +## --answers-- + +TIFF, GIF, PNG, and SVG. + +--- + +JPG, PNG, GIF, and SVG. + +--- + +JPG, PDF, SVG, and GIF. + +## --video-solution-- + +2 diff --git a/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/project-create-a-recipe-page.md b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/project-create-a-recipe-page.md new file mode 100644 index 00000000000..657a3f6e32d --- /dev/null +++ b/curriculum/challenges/arabic/10-coding-interview-prep/the-odin-project/project-create-a-recipe-page.md @@ -0,0 +1,204 @@ +--- +id: 6391d1a4f7ac71efd0621380 +title: Build a Recipe Page Project +challengeType: 14 +dashedName: project-create-a-recipe-page +--- + +# --description-- + +The website will consist of a main index page which will have links to a few recipes. The website won’t look very pretty by the time you’ve finished. + +**User Stories:** + +1. Your recipe page should contain a `DOCTYPE` tag. +1. Your recipe page should include an `html` element with a `head` and `body` element as children. +1. You should have a `title` element within the `head` element with the text `The Odin Recipes`. +1. You should see an `h1` element that has the text `Creamy Chocolate Fudge`. +1. You should see an image with the url `*placeholder-fcc-cdn*` with a fitting `alt` text. +1. There should be an `h2` element with the text `Description` under the image. +1. You should see a couple of paragraphs under `Description` that describe the recipe. +1. There should be an `h2` element with the text `Ingredients` +1. Under the `Ingredients` heading there should be an unordered list with the ingredients needed for the recipe. +1. Under the list of ingredients add another heading called `Steps`. +1. You should see an ordered list with a couple of steps needed to complete the recipe. +1. Under the steps there should be an `h2` element with the text `More Recipes` +1. You should see a couple of links to other recipes inside an unordered list which has a couple of list items with anchor elements within. +1. These anchor elements should have `href` attribute with the value set to `#` + +# --hints-- + +You should have a `DOCTYPE` tag. + +```js +assert(code.match(//gi)); +``` + +You should have a `html` element with `head` and `body` element. + +```js +const html = document.querySelectorAll('html')[0]; +const head = document.querySelectorAll('html > head')[0]; +const body = document.querySelectorAll('html > body')[0]; + +assert(html && head && body); +``` + +You should have a `title` element within the `head` element that contains the text `The Odin Recipes`. + +```js +assert(document.querySelectorAll('HEAD > TITLE')[0].innerText == 'The Odin Recipes'); +``` + +You should have a `h1` element within your `body` element that contains the text `Creamy Chocolate Fudge`. + +```js +assert(document.querySelectorAll('BODY > H1')[0].innerText == 'Creamy Chocolate Fudge'); +``` + +You should have an image with the url `*placeholder-fcc-cdn*` with an `alt` attribute that has a fitting text. + +```js +const img = document.querySelectorAll('IMG')[0]; + +assert(img && img.alt !='' && img.src === 'https://i.imgur.com/p0J5baJ.jpg') +``` + +You should have an `h2` element with the text `Description`. + +```js +const h2 = document.querySelectorAll('H2')[0]; + +assert(h2.innerText == 'Description'); +``` + +You should have at least two `p` elements describing the recipe. + +```js +const paragraphs = document.querySelectorAll('P'); + +assert(paragraphs.length > 1); +``` + +You should have an `h2` element with the text `Ingredients`. + +```js +const h2 = document.querySelectorAll('H2')[1]; + +assert(h2.innerText == 'Ingredients'); +``` + +You should have an unordered list `