수

플렉스 방향

· 2017-09-26 (화) 22:47:11 · 1942

플렉스 방향


flex-direction속성 플렉스 콘테이너 내의가요 항목의 방향을 지정한다. 기본값은 flex-direction입니다 row(왼쪽에서 오른쪽, 위에서 아래).


다른 값은 다음과 같습니다.


1. row-reverse - 쓰기 모드 (방향)가 왼쪽에서 오른쪽 인 경우 플렉스 항목이 오른쪽에서 왼쪽으로 배치됩니다

2. column - 쓰기 시스템이 가로 인 경우 플렉스 항목이 세로로 배치됩니다.

3. column-reverse - 열과 같지만 반대입니다.


다음 예제에서는 row-reverse값 을 사용한 결과를 보여줍니다 .


예

.flex-container {

    display: -webkit-flex;

    display: flex;

    -webkit-flex-direction: row-reverse;

    flex-direction: row-reverse;

    width: 400px;

    height: 250px;

    background-color: lightgrey;

}




<!DOCTYPE html>

<html>

<head>

<style> 

.flex-container {

    display: -webkit-flex;

    display: flex;

    -webkit-flex-direction: row-reverse;

    flex-direction: row-reverse;

    width: 400px;

    height: 250px;

    background-color: lightgrey;

}


.flex-item {

    background-color: cornflowerblue;

    width: 100px;

    height: 100px;

    margin: 10px;

}

</style>

</head>

<body>


<div class="flex-container">

  <div class="flex-item">flex item 1</div>

  <div class="flex-item">flex item 2</div>

  <div class="flex-item">flex item 3</div>  

</div>


</body>

</html>


댓글을 작성하시려면 로그인이 필요합니다.

퍼블리셔팁

1,282건

퍼블리싱과 관련된 유용한 정보를 공유하세요. 질문은 상단의 QA에서 해주시기 바랍니다.

+
분류 제목 글쓴이 날짜 조회
CSS 17-10-11 조회 2,728
CSS 17-10-11 조회 2,723
HTML 17-10-07 조회 3,526
HTML 17-10-06 조회 3,380
CSS 17-09-29 조회 2,311
CSS 17-09-29 조회 2,677
CSS 17-09-29 조회 2,535
CSS 17-09-26 조회 4,072
CSS 17-09-26 조회 2,733
CSS 17-09-26 조회 1,943
CSS 17-09-22 조회 2,253
CSS 17-09-22 조회 2,420
CSS 17-09-22 조회 2,381
HTML 17-09-22 조회 4,797
CSS 17-09-21 조회 1,933
CSS 17-09-21 조회 2,061
CSS 17-09-21 조회 1,928
CSS 17-09-19 조회 1,958
CSS 17-09-19 조회 1,641
CSS 17-09-19 조회 1,498
CSS 17-09-18 조회 2,591
CSS 17-09-18 조회 2,388
CSS 17-09-18 조회 2,376
CSS 17-09-14 조회 2,419
CSS 17-09-14 조회 2,096
CSS 17-09-14 조회 2,149
CSS 17-09-11 조회 2,482
CSS 17-09-11 조회 2,330
CSS 17-09-11 조회 2,134
CSS 17-09-10 조회 1,999