HTML DOM Style justifyContent property
Examples
In the surrounding flexible <div> element is left blank:
document.getElementById("main".style.justifyContent="space-between";
try it"
Definition and Usage
justifyContent in alignment within the container (level) when not occupied all the available space on the spindle flexible container.
Tip: Use alignContent property alignment axis of the cross (vertical).
Browser Support
Firefox, Opera and Chrome support justify-content attribute.
grammar
Back justifyContent properties:
object .style.justifyContent
Setting justifyContent properties:
object .style.justifyContent="flex-start|flex-end|center|space-between|space-around|initial|inherit"
Property Value
值 | 描述 |
---|---|
flex-start | 默认值。项目位于容器的开头。 |
flex-end | 项目位于容器的结尾。 |
center | 项目位于容器的中心。 |
space-between | 项目位于各行之间留有空白的容器内。 |
space-around | 项目位于各行之前、之间、之后都留有空白的容器内。 |
initial | 设置该属性为它的默认值。请参阅 initial 。 |
inherit | 从父元素继承该属性。请参阅 inherit 。 |
technical details
Defaults: | flex-start |
---|---|
return value: | String representing justify-content element attributes. |
CSS version | CSS3 |
related articles
CSS Reference Manual: The justify-Content attributes
HTML DOM STYLE Reference: alignContent property
HTML DOM STYLE Reference: alignItems property
HTML DOM STYLE Reference: alignSelf property