• 회원가입
  • 로그인
  • 구글아이디로 로그인

[flex] CSS - flex-direction 속성(C) ★★ - 기본축 방향 결정. (= flex-direction속성 = 플렉스디렉션속성)

목차
  1. flex-direction 예제 - 기본축 방향 결정
  2. flex-direction 정의
  3. flex-direction 구문
  4. 세로축+끝단+아이템(역순/순차)
  5. flex-direction 관련 주소

 

flex-direction 예제 - 기본축 방향 결정 

flex-direction:row-reverse; (가로축 방향 + 아이템 역순 + 오른쪽 정렬) 

 

<style> 

#hz {

  width: 400px;

  height: 200px;

  border: 1px solid silver;

  display: -webkit-flex; /* Safari */

  -webkit-flex-direction: row-reverse; /* Safari 6.1+ */

  display: flex;

  flex-direction: row-reverse;

}


#hz div {

  width: 50px;

  height: 50px;

}

</style>


<div id="hz">

  <div style="background-color:coral;">홈</div>

  <div style="background-color:lightblue;">짱</div>

  <div style="background-color:khaki;">닷</div>

  <div style="background-color:pink;">컴</div>

  <div style="background-color:lightgrey;">만</div>

  <div style="background-color:lightgreen;">세</div>

</div>


결과보기

PS. 위 예제 핑크색 속성값을 바꿔가며 확인 권장.

 

flex-direction 정의

 

기본축 방향 결정. (= 플렉스 아이템 방향 지정.)

 


 

1.

  • 플렉스 Container 요소 (= 플렉스 상자)에 적용.
  • flex-flow 속성 - flex-direction 속성과 flow-wrap 속성을 일괄 지정.

 

2.

  • 기본값: row
  • 상속여부: X
  • 애니효과: X
  • CSS버전: CSS3
  • JS구문: object.style.flexDirection="column-reverse";

 

3.

IE10 이상 최신브라우저 지원.

※ IE 10은 -ms-접두어 필요.

 

4. MDN flex-direction 예제보기

https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction

 

 

flex-direction 구문

 

selector {flex-direction: row|row-reverse|column|column-reverse|initial|inherit;}

 


[속성값]

 

row

(가로축 방향 + 아이템 순차 + 왼쪽 정렬) (기본값)

 

row-reverse

(가로축 방향 + 아이템 역순 + 오른쪽 정렬)

 

column 

(세로축 방향 + 아이템 순차 + 상단 정렬)

 

column-reverse

(세로축 방향 + 아이템 역순 + 하단 정렬)

 

initial

이 속성의 기본값으로 설정.

 

inherit

부모요소의 속성값 상속.

 

 

세로축+끝단+아이템(역순/순차)

 

flex-direction:column-reverse

세로축 기준 + 끝단 배치 + 아이템 역순

vs

flex-direction:column; justify-content:flex-end

세로축 기준 + 끝단 배치 + 아이템 순차

 

 

flex-direction 관련 주소

 

mdn flex-direction 강의

https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction (영어)

https://developer.mozilla.org/ko/docs/Web/CSS/flex-direction (한국어)

 


 


분류 제목
transition CSS - transition-duration 속성 ★ - 트랜지션 완료에 걸리는 시간 (= transiti…
transition CSS - transition-property 속성 - 트랜지션 효과 적용할 속성명 지정 (= transit…
transition CSS - transition-timing-function 속성 - 트랜지션 속도변경곡선 (= transit…
animation CSS - @keyframes 구문 - 애니메이션 코드 사용 선언 (= 애니사용 = @keyframes속성 …
animation CSS - animation 속성 ★ - 애니메이션 단축속성 (= animation속성 = 애니메이션속성, …
animation CSS - animation-delay 속성 - 애니지연시간 (= 작동지연시간 = 작동대기시간 = 작동준비시…
animation CSS - animation-direction 속성 - 애니방향 (= 움직임방향 = 애니메이션디렉션속성, I…
animation CSS - animation-duration 속성 - 애니지속시간 (= 애니완료소요시간 = 움직임완료소요시간…
animation CSS - animation-fill-mode 속성 - 애니미작동스타일 (= 움직임 작동안할때 스타일 = 애…
animation CSS - animation-iteration-count 속성 - 애니반복횟수 (= 움직임반복횟수, IE10…
animation CSS - animation-name 속성 - 키프레임명 (= 키프레임이름 = 애니이름 = 애니명 = 애니메…
animation CSS - animation-play-state 속성 - 애니재생상태 (= 애니작동상태설정 = 움직임 재생/…
animation CSS - animation-timing-function 속성 - 애니재생중속도변화 (= 움직임 중 속도변경…
image CSS - Rounded Images (둥근/동그란 이미지 만들기 = 이미지 테두리 둥글게/동그랗게) - I…
image CSS - Thumbnail Images - (썸네일 이미지 스타일)
image CSS - enter an Image (이미지 가운데정렬/중앙정렬)
image CSS - Image Text - (이미지 위에 텍스트 배치/띄우기)
image CSS - Polaroid Images / Cards - (폴라로이드 이미지)
image CSS - Image Filter - (이미지 필터 - 흑백/흐림 효과)
image CSS - Image Hover Overlay - (이미지 마우스오버시 효과 = 이미지허버효과 = 이미지마우…
9/25
목록
찾아주셔서 감사합니다. Since 2012