freeCodeCamp/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/nest-many-elements-within-a...

3.5 KiB

id title challengeType videoUrl localeTitle
bad87fee1348bd9aede08835 Nest Many Elements within a Single div Element 0 Nest العديد من العناصر داخل عنصر div مفرد

Description

عنصر div ، المعروف أيضًا باسم عنصر القسمة ، هو حاوية للأغراض العامة للعناصر الأخرى. ربما يكون عنصر div هو أكثر عناصر HTML شيوعًا على الإطلاق. تمامًا مثل أي عنصر آخر غير الإغلاق الذاتي ، يمكنك فتح عنصر div باستخدام <div> وإغلاقه في سطر آخر باستخدام </div> .

Instructions

اجعل "تحب قطط الأشياء" و "أشياء تكره القطط" تسرد كل عنصر div واحد. تلميح: حاول وضع الخاص بك افتتاح div العلامة فوق بك "القطط الأمور الحب" p العنصر الخاص بك وإغلاق div الوسم الخاص بك بعد إغلاق ol العلامة بحيث أن كلا من القوائم الخاصة بك هي واحدة ضمن div .

Tests

tests:
  - text: ضع عناصر <code>p</code> داخل عنصر <code>div</code> الخاص بك.
    testString: 'assert($("div").children("p").length > 1, "Nest your <code>p</code> elements inside your <code>div</code> element.");'
  - text: عش <code>ul</code> داخل عنصر <code>div</code> الخاص بك.
    testString: 'assert($("div").children("ul").length > 0, "Nest your <code>ul</code> element inside your <code>div</code> element.");'
  - text: قم <code>ol</code> عنصر <code>ol</code> الخاص بك داخل عنصر <code>div</code> الخاص بك.
    testString: 'assert($("div").children("ol").length > 0, "Nest your <code>ol</code> element inside your <code>div</code> element.");'
  - text: تأكد من أن عنصر <code>div</code> يحتوي على علامة إغلاق.
    testString: 'assert(code.match(/<\/div>/g) && code.match(/<\/div>/g).length === code.match(/<div>/g).length, "Make sure your <code>div</code> element has a closing tag.");'

Challenge Seed

<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>flea treatment</li>
    <li>thunder</li>
    <li>other cats</li>
  </ol>

  <form action="/submit-cat-photo">
    <label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
    <label><input type="radio" name="indoor-outdoor"> Outdoor</label><br>
    <label><input type="checkbox" name="personality" checked> Loving</label>
    <label><input type="checkbox" name="personality"> Lazy</label>
    <label><input type="checkbox" name="personality"> Energetic</label><br>
    <input type="text" placeholder="cat photo URL" required>
    <button type="submit">Submit</button>
  </form>
</main>

Solution

// solution required