خاصية محاذاة النمط العناصر
مثال
ضع المحاذاة لجميع عناصر عنصر <div> المرن في بداية الحاوية:
document.getElementById("main").style.alignItems = "flex-start";
التعريف والاستخدام
تحدد الخاصية alignItems المحاذاة الافتراضية للعناصر الموجودة داخل الحاوية المرنة.
تلميح: استخدم خاصية align-self لكل عنصر لتجاوز خاصية align-items.
دعم المتصفح
تحدد الأرقام الواردة في الجدول إصدار المتصفح الأول الذي يدعم الخاصية بالكامل.
تحدد الأرقام المتبوعة بـ Webkit الإصدار الأول الذي يعمل بالبادئة.
Property | |||||
---|---|---|---|---|---|
alignItems | 21.0 | 11.0 | 20.0 | 9.0 7.0 Webkit |
12.1 |
بناء الجملة
قم بإرجاع خاصية alignItems:
object.style.alignItems
قم بتعيين خاصية alignItems:
object.style.alignItems = "stretch|center|flex-start|flex-end|baseline|initial|inherit"
قيم الملكية
Value | Description |
---|---|
stretch | Default. Items are stretched to fit the container |
center | Items are positioned at the center of the container |
flex-start | Items are positioned at the beginning of the container |
flex-end | Items are positioned at the end of the container |
baseline | Items are positioned at the baseline of the container |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
تفاصيل تقنية
القيمة الافتراضية: | تمتد |
---|---|
قيمة الإرجاع: | سلسلة ، تمثل خاصية محاذاة العناصر لعنصر |
إصدار CSS | CSS3 |
الصفحات ذات الصلة
مرجع CSS: خاصية محاذاة العناصر
مرجع HTML DOM STYLE: alignContent property
مرجع نمط HTML DOM: خاصية alignSelf