order CSS 속성은 flex-container/grid-container 요소 내부에 존재하는 flex-item/grid-item 요소의 배치 순서를 결정하는 속성입니다. 형제 요소로 렌더링 된 -item 요소들은 기본적으로 order 값을 기준으로하여 오름차순으로 배치됩니다. 만약, order 속성의 값이 동일한 -item 요소일 경우, 소스코드를 기준으로 순서가 정해집니다.

Syntax

/* <integer> values */
order: 5;
order: -5; 

/* Global values */
order: inherit;
order: initial;
order: unset;

Note: order 속성은 논리적인 순서나 탭 순서와는 전혀 상관 없는 화면에 보이는 순서에만 영향을 주게 됩니다. order 속성은 반드시 음성과 같은 시각적 요소를 제외한 요소에 사용되어야만 합니다.

Values

<integer>
flex-item 에서 사용 할 순서 그룹을 나타냅니다. 정수값(0, +, -)을 사용할 수 있습니다.

Formal syntax

<integer>

Example

Here is a basic HTML chunk:

<header>...</header>
<main>
  <article>Article</article>
  <nav>Nav</nav>
  <aside>Aside</aside>
</main>
<footer>...</footer>

The following CSS code creates a classic two-sidebar layout surrounding a content block. The Flexible Box Layout Module automatically creates blocks of equal vertical size and uses as much horizontal space as available.

main { display: flex;  text-align:center; }
main > article { flex:1;        order: 2; }
main > nav     { width: 200px;  order: 1; }
main > aside   { width: 200px;  order: 3; }

Result

Accessibility concerns

order 속성을 사용한다면, 실제 DOM 순서와 화면에 보여지는 컨텐츠의 순서간의 정확성을 보장할 수 없습니다. 해당 속성은 screen reader 기기를 이용하는 사용자에게 UX적인 측면의 이슈를 초래할 수 있습니다.

Specifications

Specification Status Comment
CSS Flexible Box Layout Module
The definition of 'order' in that specification.
Candidate Recommendation Initial definition

초기값0
적용대상flex items and absolutely-positioned flex container children
상속no
Mediavisual
Computed valueas specified
Animation typean integer
Canonical orderthe unique non-ambiguous order defined by the formal grammar

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support 29
Full support 29
Full support 21
Prefixed
Prefixed Requires the vendor prefix: -webkit-
Edge Full support 12
Full support 12
Full support 12
Prefixed
Prefixed Requires the vendor prefix: -webkit-
Firefox Full support 20
Notes
Full support 20
Notes
Notes Since Firefox 28, multi-line flexbox is supported.
Full support 49
Prefixed
Prefixed Requires the vendor prefix: -webkit-
Full support 48
Prefixed Disabled
Prefixed Requires the vendor prefix: -webkit-
Disabled From version 48: this feature is behind the layout.css.prefixes.webkit preference (needs to be set to true). To change preferences in Firefox, visit about:config.
No support 18 — 28
Disabled
Disabled From version 18 until version 28 (exclusive): this feature is behind the layout.css.flexbox.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE Full support 11
Full support 11
Full support 10
Prefixed
Prefixed Requires the vendor prefix: -ms-
Opera Full support 12.1Safari Full support 9
Full support 9
Full support 7
Prefixed
Prefixed Requires the vendor prefix: -webkit-
WebView Android Full support 4.4
Full support 4.4
Full support Yes
Prefixed
Prefixed Requires the vendor prefix: -webkit-
Chrome Android Full support 29
Full support 29
Full support 25
Prefixed
Prefixed Requires the vendor prefix: -webkit-
Edge Mobile Full support Yes
Full support Yes
Full support Yes
Prefixed
Prefixed Requires the vendor prefix: -webkit-
Firefox Android Full support 20
Notes
Full support 20
Notes
Notes Since Firefox 28, multi-line flexbox is supported.
Full support 49
Prefixed
Prefixed Requires the vendor prefix: -webkit-
Full support 48
Prefixed Disabled
Prefixed Requires the vendor prefix: -webkit-
Disabled From version 48: this feature is behind the layout.css.prefixes.webkit preference (needs to be set to true). To change preferences in Firefox, visit about:config.
No support 18 — 28
Disabled
Disabled From version 18 until version 28 (exclusive): this feature is behind the layout.css.flexbox.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android Full support 12.1Safari iOS Full support 9
Full support 9
Full support 7
Prefixed
Prefixed Requires the vendor prefix: -webkit-
Samsung Internet Android ?
Absolutely-positioned flex childrenChrome Full support YesEdge Full support 12Firefox No support NoIE Full support 10Opera Full support 12.1Safari Full support YesWebView Android ? Chrome Android ? Edge Mobile ? Firefox Android No support NoOpera Android Full support 12.1Safari iOS Full support YesSamsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
See implementation notes.
See implementation notes.
User must explicitly enable this feature.
User must explicitly enable this feature.
Requires a vendor prefix or different name for use.
Requires a vendor prefix or different name for use.

See also

문서 태그 및 공헌자

이 페이지의 공헌자: limjungmok, dbwodlf3
최종 변경자: limjungmok,