From 17eb7301bd1519a507799947fb89331714559eb2 Mon Sep 17 00:00:00 2001 From: Jessica Wilkins <67210629+jdwilkin4@users.noreply.github.com> Date: Fri, 26 Apr 2024 10:33:16 -0700 Subject: [PATCH] fix(curriculum): inconsistencies for code examples in cat photo app (#54526) Co-authored-by: Naomi --- .../5dc174fcf86c76b9248c6eb2.md | 14 +++++++++++++- .../5dc1798ff86c76b9248c6eb3.md | 13 ++++++++++++- .../5dc17dc8f86c76b9248c6eb5.md | 8 +++++++- .../5dc2385ff86c76b9248c6eb7.md | 9 +++++++++ .../5dc23991f86c76b9248c6eb8.md | 9 +++++++++ .../5dc24165f86c76b9248c6ebc.md | 8 +++++++- .../5dc24614f86c76b9248c6ebd.md | 8 +++++++- .../5ddbd81294d8ddc1510a8e56.md | 8 +++++++- .../5dfa22d1b521be39a3de7be0.md | 2 +- .../5dfa2407b521be39a3de7be1.md | 10 ++++++++++ .../5dfa30b9eacea3f48c6300ad.md | 8 ++++++++ .../5dfa37b9eacea3f48c6300b0.md | 2 ++ .../5dfb5ecbeacea3f48c6300b1.md | 4 +++- .../5dfb6a35eacea3f48c6300b4.md | 11 ++++++++++- .../5ef9b03c81a63668521804d0.md | 2 ++ .../5ef9b03c81a63668521804d6.md | 2 ++ .../5ef9b03c81a63668521804d7.md | 10 +++++++++- .../5ef9b03c81a63668521804d9.md | 8 +++++++- .../5ef9b03c81a63668521804da.md | 2 +- .../5ef9b03c81a63668521804dc.md | 8 +++++++- .../5ef9b03c81a63668521804dd.md | 10 +++++++++- .../5ef9b03c81a63668521804de.md | 7 +++++++ .../5ef9b03c81a63668521804df.md | 6 ++++++ .../5ef9b03c81a63668521804e2.md | 2 +- .../5ef9b03c81a63668521804e5.md | 10 +++++++++- .../5ef9b03c81a63668521804e7.md | 2 +- .../5ef9b03c81a63668521804ea.md | 2 ++ .../5ef9b03c81a63668521804ec.md | 4 +++- .../5ef9b03c81a63668521804ee.md | 2 ++ .../5efc4f528d6a74d05e68af74.md | 7 +++++++ .../5f07be6ef7412fbad0c5626b.md | 9 +++++++++ .../62bb4009e3458a128ff57d5d.md | 2 ++ .../7cf9b03d81a65668421804c3.md | 8 +++++++- 33 files changed, 198 insertions(+), 19 deletions(-) diff --git a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc174fcf86c76b9248c6eb2.md b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc174fcf86c76b9248c6eb2.md index a6b5c0dcbcf..1d313ae2892 100644 --- a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc174fcf86c76b9248c6eb2.md +++ b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc174fcf86c76b9248c6eb2.md @@ -7,7 +7,19 @@ dashedName: step-1 # --description-- -HTML elements have opening tags like `

` and closing tags like `

`. The text an element will display goes between its opening and closing tags. +HTML elements have an opening and closing tag with content in between. + +Here is the basic syntax: + +```html +content +``` + +The first element you will learn about is the `h1` element. The `h1` element is a heading element and is used for the main heading of a webpage. + +```html +

This is a main heading

+``` Change the text of the `h1` element below from `Hello World` to `CatPhotoApp` and watch the change in the browser preview. diff --git a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc1798ff86c76b9248c6eb3.md b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc1798ff86c76b9248c6eb3.md index b121a5feca6..6481ebe0b34 100644 --- a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc1798ff86c76b9248c6eb3.md +++ b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc1798ff86c76b9248c6eb3.md @@ -7,7 +7,18 @@ dashedName: step-2 # --description-- -The `h1` through `h6` heading elements are used to signify the importance of content below them. The lower the number, the higher the importance, so `h2` elements have less importance than `h1` elements. Only use one `h1` element per page and place lower importance headings below higher importance headings. +The `h1` through `h6` heading elements are used to signify the importance of content below them. The lower the number, the higher the importance, so `h2` elements have less importance than `h1` elements. + +```html +

most important heading element

+

second most important heading element

+

third most important heading element

+

fourth most important heading element

+
fifth most important heading element
+
least important heading element
+``` + +Only use one `h1` element per page and place lower importance headings below higher importance headings. Below the `h1` element, add an `h2` element with this text: diff --git a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc17dc8f86c76b9248c6eb5.md b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc17dc8f86c76b9248c6eb5.md index 303e1ec4147..f92eeab3cb4 100644 --- a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc17dc8f86c76b9248c6eb5.md +++ b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc17dc8f86c76b9248c6eb5.md @@ -7,7 +7,13 @@ dashedName: step-4 # --description-- -Commenting allows you to leave messages without affecting the browser display. It also allows you to make code inactive. A comment in HTML starts with ``. For example, the comment `` contains the text `TODO: Remove h1`. +Commenting allows you to leave messages without affecting the browser display. It also allows you to make code inactive. A comment in HTML starts with ``. + +Here is an example of a comment with the `TODO: Remove h1`: + +```html + +``` Add a comment above the `p` element with this text: diff --git a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc2385ff86c76b9248c6eb7.md b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc2385ff86c76b9248c6eb7.md index 3904cebdf21..6025e8f9eaf 100644 --- a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc2385ff86c76b9248c6eb7.md +++ b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc2385ff86c76b9248c6eb7.md @@ -9,6 +9,15 @@ dashedName: step-5 HTML5 has some elements that identify different content areas. These elements make your HTML easier to read and help with Search Engine Optimization (SEO) and accessibility. +The `main` element is used to represent the main content of the body of an HTML document. Content inside the `main` element should be unique to the document and should not be repeated in other parts of the document. + +```html +
+

Most important content of the document

+

Some more important content...

+
+``` + Identify the main section of this page by adding a `
` opening tag before the `h1` element, and a `
` closing tag after the `p` element. # --hints-- diff --git a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc23991f86c76b9248c6eb8.md b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc23991f86c76b9248c6eb8.md index 823f4fae2fb..1f6f7925b49 100644 --- a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc23991f86c76b9248c6eb8.md +++ b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc23991f86c76b9248c6eb8.md @@ -9,6 +9,15 @@ dashedName: step-6 In the previous step, you put the `h1`, `h2`, comment, and `p` elements inside the `main` element. This is called *nesting*. Nested elements should be placed two spaces further to the right of the element they are nested in. This spacing is called indentation and it is used to make HTML easier to read. +Here is an example of nesting and indentation: + +```html +
+

Most important content of the document

+

Some more important content...

+
+``` + The `h1` element, `h2` element and the comment are indented two spaces more than the `main` element in the code below. Use the space bar on your keyboard to add two more spaces in front of the `p` element so that it is indented properly as well. # --hints-- diff --git a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc24165f86c76b9248c6ebc.md b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc24165f86c76b9248c6ebc.md index 36f1648e09b..fa3d1706989 100644 --- a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc24165f86c76b9248c6ebc.md +++ b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc24165f86c76b9248c6ebc.md @@ -7,7 +7,13 @@ dashedName: step-9 # --description-- -All `img` elements should have an `alt` attribute. The `alt` attribute's text is used for screen readers to improve accessibility and is displayed if the image fails to load. For example, `A cat` has an `alt` attribute with the text `A cat`. +All `img` elements should have an `alt` attribute. The `alt` attribute's text is used for screen readers to improve accessibility and is displayed if the image fails to load. + +Here is an example of an `img` element with an `alt` attribute: + +```html +A cat +``` Inside the `img` element, add an `alt` attribute with this text: diff --git a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc24614f86c76b9248c6ebd.md b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc24614f86c76b9248c6ebd.md index fb3a5f107ff..8a4743a1801 100644 --- a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc24614f86c76b9248c6ebd.md +++ b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc24614f86c76b9248c6ebd.md @@ -7,7 +7,13 @@ dashedName: step-10 # --description-- -You can link to another page with the anchor (`a`) element. For example, `` would link to `freecodecamp.org`. +You can link to another page with the anchor (`a`) element. + +Here is an example linking to `https://www.freecodecamp.org`: + +```html + +``` Add an anchor element after the paragraph that links to `https://freecatphotoapp.com`. At this point, the link won’t show up in the preview. diff --git a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5ddbd81294d8ddc1510a8e56.md b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5ddbd81294d8ddc1510a8e56.md index 7018871ed0b..899253f5331 100644 --- a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5ddbd81294d8ddc1510a8e56.md +++ b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5ddbd81294d8ddc1510a8e56.md @@ -7,7 +7,13 @@ dashedName: step-11 # --description-- -A link's text must be placed between the opening and closing tags of an anchor (`a`) element. For example, `click here to go to freeCodeCamp.org` is a link with the text `click here to go to freeCodeCamp.org`. +A link's text must be placed between the opening and closing tags of an anchor (`a`) element. + +Here is an example of a link with the text `click here to go to freeCodeCamp.org`: + +```html +click here to go to freeCodeCamp.org +``` Add the anchor text `link to cat pictures` to the anchor element. This will become the link's text. diff --git a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa22d1b521be39a3de7be0.md b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa22d1b521be39a3de7be0.md index de8cbc35287..913170f5439 100644 --- a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa22d1b521be39a3de7be0.md +++ b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa22d1b521be39a3de7be0.md @@ -68,8 +68,8 @@ assert.match(code, /

see more ]*>cat photos<\/a> in our gallery\.?<\/p>/i --fcc-editable-region--

See more cat photos in our gallery.

- link to cat pictures --fcc-editable-region-- + link to cat pictures A cute orange cat lying on its back. diff --git a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa2407b521be39a3de7be1.md b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa2407b521be39a3de7be1.md index c9922875209..462d185904c 100644 --- a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa2407b521be39a3de7be1.md +++ b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa2407b521be39a3de7be1.md @@ -7,6 +7,16 @@ dashedName: step-14 # --description-- +To open links in a new tab, you can use the `target` attribute on the anchor (`a`) element. + +The `target` attribute specifies where to open the linked document. `target="_blank"` opens the linked document in a new tab or window. + +Here is the basic syntax for an `a` element with a `target` attribute: + +```html +freeCodeCamp +``` + Add a `target` attribute with the value `_blank` to the anchor (`a`) element's opening tag, so that the link opens in a new tab. # --hints-- diff --git a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa30b9eacea3f48c6300ad.md b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa30b9eacea3f48c6300ad.md index 0994125b0d9..312dd07e0f9 100644 --- a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa30b9eacea3f48c6300ad.md +++ b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa30b9eacea3f48c6300ad.md @@ -9,6 +9,14 @@ dashedName: step-15 In previous steps you used an anchor element to turn text into a link. Other types of content can also be turned into a link by wrapping it in anchor tags. +Here is an example of turning an image into a link: + +```html + + A photo of a cat. + +``` + Turn the image into a link by surrounding it with necessary element tags. Use `https://freecatphotoapp.com` as the anchor's `href` attribute value. # --hints-- diff --git a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa37b9eacea3f48c6300b0.md b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa37b9eacea3f48c6300b0.md index a3cd59fe5df..0b6a34dc4db 100644 --- a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa37b9eacea3f48c6300b0.md +++ b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa37b9eacea3f48c6300b0.md @@ -7,6 +7,8 @@ dashedName: step-20 # --description-- +To create an unordered list of items, you can use the `ul` element. + After the `h3` element with the `Things cats love:` text, add an unordered list (`ul`) element. Note that nothing will be displayed at this point. # --hints-- diff --git a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfb5ecbeacea3f48c6300b1.md b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfb5ecbeacea3f48c6300b1.md index 1efd3dbed3c..21c2d930d17 100644 --- a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfb5ecbeacea3f48c6300b1.md +++ b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfb5ecbeacea3f48c6300b1.md @@ -7,7 +7,9 @@ dashedName: step-21 # --description-- -Use list item (`li`) elements to create items in a list. Here is an example of list items in an unordered list: +The `li` element is used to create a list item in an ordered or unordered list. + +Here is an example of list items in an unordered list: ```html