نمط المرن الملكية
مثال
اجعل جميع العناصر المرنة بنفس الطول ، بغض النظر عن محتواها:
for (i = 0; i
y[i].style.flex = "1";
}
التعريف والاستخدام
تحدد الخاصية flex أو ترجع طول العنصر ، بالنسبة لبقية العناصر المرنة داخل نفس الحاوية.
الخاصية flex هي اختصار لخصائص flexGrow و flexShrink وخصائص flexBasis.
ملاحظة: إذا لم يكن العنصر عنصرًا مرنًا ، فلن يكون للخاصية المرن أي تأثير.
دعم المتصفح
Property | |||||
---|---|---|---|---|---|
flex | Yes | 11.0 10.0 msFlex |
Yes | 9.0 | Yes |
بناء الجملة
إعادة خاصية المرن:
object.style.flex
قم بتعيين خاصية المرن:
object.style.flex = "flex-grow flex-shrink flex-basis|auto|initial|inherit"
قيم الملكية
Value | Description |
---|---|
flex-grow | A number specifying how much the item will grow relative to the rest of the flexible items |
flex-shrink | A number specifying how much the item will shrink relative to the rest of the flexible items |
flex-basis | The length of the item. Legal values: "auto", "inherit", or a number followed by "%", "px", "em" or any other length unit |
auto | Same as 1 1 auto. |
initial | Same as 0 1 auto. Read about initial |
none | Same as 0 0 auto. |
inherit | Inherits this property from its parent element. Read about inherit |
تفاصيل تقنية
القيمة الافتراضية: | 0 1 تلقائي |
---|---|
قيمة الإرجاع: | سلسلة ، تمثل الخاصية المرنة لعنصر |
إصدار CSS | CSS3 |
الصفحات ذات الصلة
مرجع CSS: الخاصية المرنة
مرجع HTML DOM STYLE: خاصية flexBasis
مرجع HTML DOM STYLE: خاصية flexDirection
مرجع HTML DOM STYLE: خاصية flexFlow
مرجع HTML DOM STYLE: خاصية flexGrow
مرجع HTML DOM STYLE: خاصية flexShrink
مرجع HTML DOM STYLE: خاصية flexWrap
❮ نمط الكائن