freeCodeCamp/curriculum/challenges/arabic/01-responsive-web-design/css-grid/divide-the-grid-into-an-are...

3.0 KiB

id title challengeType videoUrl localeTitle
5a94fe0569fb03452672e45c Divide the Grid Into an Area Template 0 تقسيم الشبكة في قالب المنطقة

Description

يمكنك تجميع خلايا الشبكة الخاصة بك معًا في منطقة وإعطاء المنطقة اسمًا مخصصًا. القيام بذلك عن طريق استخدام grid-template-areas على الحاوية مثل هذا:
شبكة قالب والمناطق:
"رأس الصفحة الرأسية"
"advert content content"
"footer footer footer" ؛
يدمج الرمز أعلاه الخلايا الثلاث العليا معًا في منطقة مسماة header ، والخلايا الثلاثة السفلية في منطقة footer ، ويجعل منطقتين في الصف الأوسط ؛ advert content . ملحوظة
تمثل كل كلمة في التعليمة البرمجية خلية ويمثل كل زوج من علامات الاقتباس صفًا. بالإضافة إلى التصنيفات المخصصة ، يمكنك استخدام نقطة ( . ) لتعيين خلية فارغة في الشبكة.

Instructions

ضع قالب المنطقة بحيث تصبح الخلية المسمى advert عبارة عن خلية فارغة.

Tests

tests:
  - text: ''
    testString: 'assert(code.match(/.container\s*?{[\s\S]*grid-template-areas\s*?:\s*?"\s*?header\s*?header\s*?header\s*?"\s*?"\s*?.\s*?content\s*?content\s*?"\s*?"\s*?footer\s*?footer\s*?footer\s*?"\s*?;[\s\S]*}/gi), "<code>container</code> class should have a <code>grid-template-areas</code> propertiy similar to the preview but has <code>.</code> instead of the <code>advert</code> area.");'

Challenge Seed

<style>
  .item1{background:LightSkyBlue;}
  .item2{background:LightSalmon;}
  .item3{background:PaleTurquoise;}
  .item4{background:LightPink;}
  .item5{background:PaleGreen;}

  .container {
    font-size: 40px;
    min-height: 300px;
    width: 100%;
    background: LightGray;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    grid-gap: 10px;
    /* change code below this line */

    grid-template-areas:
      "header header header"
      "advert content content"
      "footer footer footer";
    /* change code above this line */
  }
</style>

<div class="container">
  <div class="item1">1</div>
  <div class="item2">2</div>
  <div class="item3">3</div>
  <div class="item4">4</div>
  <div class="item5">5</div>
</div>

Solution

// solution required