محاذاة النمط خاصية Self
مثال
عيّن المحاذاة لأحد العناصر داخل عنصر مرن ليلائم الحاوية:
document.getElementById("myBlueDiv").style.alignSelf = "stretch";
التعريف والاستخدام
تحدد الخاصية alignSelf محاذاة العنصر المحدد داخل الحاوية المرنة.
ملاحظة: تتجاوز الخاصية alignSelf خاصية alignItems للحاوية المرنة.
دعم المتصفح
تحدد الأرقام الواردة في الجدول إصدار المتصفح الأول الذي يدعم الخاصية بالكامل.
تحدد الأرقام المتبوعة بـ Webkit الإصدار الأول الذي يعمل بالبادئة.
Property | |||||
---|---|---|---|---|---|
alignSelf | 21.0 | 11.0 | 20.0 | 9.0 7.0 Webkit |
12.1 |
بناء الجملة
قم بإرجاع خاصية alignSelf:
object.style.alignSelf
قم بتعيين خاصية alignSelf:
object.style.alignSelf = "auto|stretch|center|flex-start|flex-end|baseline|initial|inherit"
قيم الملكية
Value | Description |
---|---|
auto | Default. The element inherits its parent container's align-items property, or "stretch" if it has no parent container |
stretch | The element is positioned to fit the conatiner |
center | The element is positioned at the center of the container |
flex-start | The element is are positioned at the beginning of the container |
flex-end | The element is positioned at the end of the container |
baseline | The element is 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: خاصية alignItems