خاصية محاذاة المحتوى في CSS
مثال
حزم الخطوط باتجاه مركز الحاوية المرنة:
div
{
width: 70px;
height: 300px;
border: 1px solid #c3c3c3;
display: flex;
flex-wrap: wrap;
align-content: center;
}
التعريف والاستخدام
align-content
تعدل الخاصية سلوك
خاصية الالتفاف المرن . إنه مشابه
لمحاذاة العناصر ، ولكن بدلاً من محاذاة العناصر المرنة ، فإنه يقوم بمحاذاة الخطوط المرنة.
ملاحظة: يجب أن يكون هناك سطور متعددة للعناصر حتى يكون لهذه الخاصية أي تأثير!
تلميح: استخدم خاصية justify-content لمحاذاة العناصر على المحور الرئيسي (أفقيًا).
القيمة الافتراضية: | تمتد |
---|---|
وارث: | رقم |
متحرك: | رقم. اقرأ عن animatable |
الإصدار: | CSS3 |
بناء جملة JavaScript: | الكائن .style.alignContent = "المركز" |
دعم المتصفح
تحدد الأرقام الواردة في الجدول إصدار المتصفح الأول الذي يدعم الخاصية بالكامل.
الأرقام متبوعة بـ -webkit- تحدد الإصدار الأول الذي يعمل بالبادئة.
Property | |||||
---|---|---|---|---|---|
align-content | 21.0 | 11.0 | 28.0 | 9.0 7.0 -webkit- |
12.1 |
بنية CSS
align-content: stretch|center|flex-start|flex-end|space-between|space-around|initial|inherit;
قيم الملكية
Value | Description | Play it |
---|---|---|
stretch | Default value. Lines stretch to take up the remaining space | |
center | Lines are packed toward the center of the flex container | |
flex-start | Lines are packed toward the start of the flex container | |
flex-end | Lines are packed toward the end of the flex container | |
space-between | Lines are evenly distributed in the flex container | |
space-around | Lines are evenly distributed in the flex container, with half-size spaces on either end | |
space-evenly | Lines are evenly distributed in the flex container, with equal space around them | |
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
مرجع CSS: خاصية ضبط المحتوى
مرجع HTML DOM: خاصية alignContent