Files
freeCodeCamp/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/create-an-ordered-list.md
Nicholas Carrigan (he/him) 427444c757 chore(learn): audit files for crowdin (#40838)
* chore(learn): audit files for crowdin

Audits the challenge text in the Responsive Web Design superblock to
account for words/phrases that should not be translated because they
refer to code.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

* fix: remove quotes from code

Removes instances of quoted code blocks, or code blocked quotes.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

* fix: additional uncaught quote-codes

Thanks Oliver :)

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>

* fix: so many quotes

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>

* fix: missing punctuation

Noted in a Crowdin comment.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

* fix: remove more quotes

Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>
2021-02-01 12:56:07 -07:00

2.9 KiB

id, title, challengeType, videoUrl, forumTopicId, dashedName
id title challengeType videoUrl forumTopicId dashedName
bad87fee1348bd9aedf08828 Create an Ordered List 0 https://scrimba.com/p/pVMPUv/cQ3B8TM 16824 create-an-ordered-list

--description--

HTML has another special element for creating ordered lists, or numbered lists.

Ordered lists start with an opening <ol> element, followed by any number of <li> elements. Finally, ordered lists are closed with the </ol> tag.

For example:

<ol>
  <li>Garfield</li>
  <li>Sylvester</li>
</ol>

would create a numbered list of Garfield and Sylvester.

--instructions--

Create an ordered list of the top 3 things cats hate the most.

--hints--

You should have an ordered list for Top 3 things cats hate:

assert(/Top 3 things cats hate:/i.test($('ol').prev().text()));

You should have an unordered list for Things cats love:

assert(/Things cats love:/i.test($('ul').prev().text()));

You should have only one ul element.

assert.equal($('ul').length, 1);

You should have only one ol element.

assert.equal($('ol').length, 1);

You should have three li elements within your ul element.

assert.equal($('ul li').length, 3);

You should have three li elements within your ol element.

assert.equal($('ol li').length, 3);

Your ul element should have a closing tag.

assert(
  code.match(/<\/ul>/g) &&
    code.match(/<\/ul>/g).length === code.match(/<ul>/g).length
);

Your ol element should have a closing tag.

assert(
  code.match(/<\/ol>/g) &&
    code.match(/<\/ol>/g).length === code.match(/<ol>/g).length
);

Your li element should have a closing tag.

assert(
  code.match(/<\/li>/g) &&
    code.match(/<li>/g) &&
    code.match(/<\/li>/g).length === code.match(/<li>/g).length
);

The li elements in your unordered list should not be empty.

$('ul li').each((i, val) =>
  assert(__helpers.removeWhiteSpace(val.textContent))
);

The li elements in your ordered list should not be empty.

$('ol li').each((i, val) =>
  assert(!!__helpers.removeWhiteSpace(val.textContent))
);

--seed--

--seed-contents--

<h2>CatPhotoApp</h2>
<main>
  <p>Click here to view more <a href="#">cat photos</a>.</p>

  <a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>

  <p>Things cats love:</p>
  <ul>
    <li>cat nip</li>
    <li>laser pointers</li>
    <li>lasagna</li>
  </ul>
  <p>Top 3 things cats hate:</p>

</main>

--solutions--

<h2>CatPhotoApp</h2>
<main>
  <p>Click here to view more <a href="#">cat photos</a>.</p>

  <a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>

  <p>Things cats love:</p>
  <ul>
    <li>cat nip</li>
    <li>laser pointers</li>
    <li>lasagna</li>
  </ul>
  <p>Top 3 things cats hate:</p>
  <ol>
    <li>hate 1</li>
    <li>hate 2</li>
    <li>hate 3</li>
  </ol>
</main>