스타일 justifyContent 속성
예시
유연한 <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 |
기술적 세부 사항
기본값: | 플렉스 스타트 |
---|---|
반환 값: | 요소의 justify-content 속성을 나타내는 문자열 |
CSS 버전 | CSS3 |
관련 페이지
CSS 참조: justify-content 속성
HTML DOM STYLE 참조: alignContent 속성
HTML DOM STYLE 참조: alignItems 속성
HTML DOM STYLE 참조: alignSelf 속성
❮ 스타일 개체