freeCodeCamp/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-flex-grow-property-...

2.2 KiB

id title challengeType videoUrl localeTitle
587d78ae367417b2b2512afc Use the flex-grow Property to Expand Items 0 استخدم خاصية Flex-grow لتوسيع العناصر

Description

عكس flex-shrink هو خاصية flex-grow . أذكر أن flex-shrink في حجم العناصر عندما تنكمش الحاوية. تتحكم الخاصية flex-grow حجم العناصر عندما يتم توسيع الحاوية الأصل. باستخدام مثال مماثل من التحدي الأخير ، إذا كان أحد العناصر يحتوي على قيمة flex-grow من 1 ، والآخر له قيمة flex-grow 3 ، فإن القيمة ذات القيمة 3 ستنمو بثلاثة أضعاف.

Instructions

قم بإضافة الخاصية CSS flex-grow إلى كلا #box-1 و #box-2 . Give #box-1 a value of 1 and #box-2 a value of 2.

Tests

tests:
  - text: 'يجب أن يحتوي عنصر <code>#box-1</code> على الخاصية <code>flex-grow</code> set إلى قيمة 1.'
    testString: 'assert($("#box-1").css("flex-grow") == "1", "The <code>#box-1</code> element should have the <code>flex-grow</code> property set to a value of 1.");'
  - text: 'يجب أن يحتوي عنصر <code>#box-2</code> على الخاصية <code>flex-grow</code> set to a value of 2.'
    testString: 'assert($("#box-2").css("flex-grow") == "2", "The <code>#box-2</code> element should have the <code>flex-grow</code> property set to a value of 2.");'

Challenge Seed

<style>
  #box-container {
    display: flex;
    height: 500px;
  }

  #box-1 {
    background-color: dodgerblue;
    height: 200px;

  }

  #box-2 {
    background-color: orangered;
    height: 200px;

  }
</style>

<div id="box-container">
  <div id="box-1"></div>
  <div id="box-2"></div>
</div>

Solution

// solution required