ضبط النمط خاصية المحتوى
مثال
اترك مسافة بين عناصر عنصر <div> المرن:
document.getElementById("main").style.justifyContent = "space-between";
التعريف والاستخدام
تقوم خاصية justifyContent بمحاذاة عناصر الحاوية المرنة عندما لا تستخدم العناصر كل المساحة المتوفرة على المحور الرئيسي (أفقيًا).
نصيحة: استخدم خاصية alignContent لمحاذاة العناصر الموجودة على المحور العرضي (عموديًا).
دعم المتصفح
Property | |||||
---|---|---|---|---|---|
justifyContent | Yes | 12.0 | Yes | 9.0 | Yes |
بناء الجملة
قم بإرجاع خاصية justifyContent:
object.style.justifyContent
قم بتعيين خاصية justifyContent:
object.style.justifyContent = "flex-start|flex-end|center|space-between|space-around|initial|inherit"
قيم الملكية
Value | Description |
---|---|
flex-start | Default value. Items are positioned at the beginning of the container |
flex-end | Items are positioned at the end of the container |
center | Items are positioned at the center of the container |
space-between | Items are positioned with space between the lines |
space-around | Items are positioned with space before, between, and after the lines |
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
مرجع نمط HTML DOM: خاصية alignSelf
❮ نمط الكائن