خاصية محاذاة العناصر في CSS
مثال
توسيط المحاذاة لجميع عناصر عنصر <div> المرن:
div
{
display: flex;
align-items: center;
}
التعريف والاستخدام
تحدد align-items
الخاصية المحاذاة الافتراضية للعناصر الموجودة داخل الحاوية المرنة.
نصيحة: استخدم خاصية align-self لكل عنصر لتجاوز align-items
الخاصية.
القيمة الافتراضية: | تمتد |
---|---|
وارث: | رقم |
متحرك: | رقم. اقرأ عن animatable |
الإصدار: | CSS3 |
بناء جملة JavaScript: | الكائن .style.alignItems = "المركز" |
دعم المتصفح
تحدد الأرقام الواردة في الجدول إصدار المتصفح الأول الذي يدعم الخاصية بالكامل.
الأرقام متبوعة بـ -webkit- تحدد الإصدار الأول الذي يعمل بالبادئة.
Property | |||||
---|---|---|---|---|---|
align-items | 21.0 | 11.0 | 20.0 | 9.0 7.0 -webkit- |
12.1 |
بنية CSS
align-items: stretch|center|flex-start|flex-end|baseline|initial|inherit;
قيم الملكية
Value | Description | Play it |
---|---|---|
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: خاصية محاذاة المحتوى
مرجع CSS: align-self property
مرجع HTML DOM: خاصية alignItems