2.8 KiB
2.8 KiB
id, title, challengeType, videoUrl, localeTitle
| id | title | challengeType | videoUrl | localeTitle |
|---|---|---|---|---|
| 587d78ae367417b2b2512afd | Use the flex-basis Property to Set the Initial Size of an Item | 0 | استخدم الخاصية الأساسية المرنة لتعيين الحجم الأولي لعنصر |
Description
flex-basis الحجم الأولي للعنصر قبل أن تقوم CSS بإجراء عمليات ضبط باستخدام flex-shrink أو flex-grow . الوحدات المستخدمة بواسطة الخاصية flex-basis هي نفس خصائص الحجم الأخرى ( px ، em ، % ، إلخ). عناصر قيمة الأحجام auto استنادًا إلى المحتوى. Instructions
flex-basis . أضف flex-basis إلى #box-1 و #box-2 . Give #box-1 a value of 10em and #box-2 a value of 20em . Tests
tests:
- text: 'يجب أن يحتوي عنصر <code>#box-1</code> على خاصية <code>flex-basis</code> .'
testString: 'assert($("#box-1").css("flex-basis") != "auto", "The <code>#box-1</code> element should have a <code>flex-basis</code> property.");'
- text: 'يجب أن يحتوي عنصر <code>#box-1</code> على قيمة <code>flex-basis</code> <code>10em</code> .'
testString: 'assert(code.match(/#box-1\s*?{\s*?.*?\s*?.*?\s*?flex-basis:\s*?10em;/g), "The <code>#box-1</code> element should have a <code>flex-basis</code> value of <code>10em</code>.");'
- text: 'يجب أن يكون عنصر <code>#box-2</code> الخاصية <code>flex-basis</code> .'
testString: 'assert($("#box-2").css("flex-basis") != "auto", "The <code>#box-2</code> element should have the <code>flex-basis</code> property.");'
- text: 'يجب أن يحتوي عنصر <code>#box-2</code> على قيمة <code>flex-basis</code> <code>20em</code> .'
testString: 'assert(code.match(/#box-2\s*?{\s*?.*?\s*?.*?\s*?flex-basis:\s*?20em;/g), "The <code>#box-2</code> element should have a <code>flex-basis</code> value of <code>20em</code>.");'
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