order
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since 2015ë 9ì.
order CSS ìì±ì íë ì¤ ëë 그리ë 컨í
ì´ë ììì íì¬ ììì ë°°ì¹ ìì를 ì§ì í©ëë¤. 컨í
ì´ë ìì´í
ì ì ë ¬ ììë ì¤ë¦ì°¨ì order ê°ì´ê³ , ê°ì ê°ì¼ ê²½ì° ìì¤ ì½ëì ììëë¡ ì ë ¬ë©ëë¤.
ìëí´ ë³´ê¸°
order: 0;
order: 3;
order: -1;
order: 2;
<section class="default-example" id="default-example">
<div class="transition-all" id="example-element">Box 1:</div>
<div style="order: 1">Box 2: <code>order: 1;</code></div>
<div style="order: 2">Box 3: <code>order: 2;</code></div>
<div style="order: 2">Box 4: <code>order: 2;</code></div>
<div style="order: 3">Box 5: <code>order: 3;</code></div>
</section>
.default-example {
max-height: 300px;
display: flex;
flex-flow: column;
}
.default-example > div {
background-color: rgba(0, 0, 255, 0.2);
border: 3px solid blue;
margin: 0.5rem;
padding: 0.5rem;
flex: 1;
}
#example-element {
background-color: rgba(255, 0, 200, 0.2);
border: 3px solid rebeccapurple;
}
#example-element::after {
content: attr(style);
outline: 2px dashed;
font-family: monospace;
}
구문
/* <integer> ê° */
order: 5;
order: -5;
/* ì ì ê° */
order: inherit;
order: initial;
order: unset;
ì°¸ê³ :
order ìì±ì ë
¼ë¦¬ì ì¸ ììë í ìììë ì í ìê´ ìì´ íë©´ì ë³´ì´ë ìììë§ ìí¥ì ì¤ëë¤. ë°ë¼ì ë¹ìê°ì 매체ì ì ì©í´ì ìë©ëë¤.
ê°
<integer>-
ìì´í ì ìì.
íì 구문
order =
<integer>
<integer> =
<number-token>
ìì
<header>...</header>
<main>
<article>Article</article>
<nav>Nav</nav>
<aside>Aside</aside>
</main>
<footer>...</footer>
ìì ê°ì 기본ì ì¸ HTMLìì, ë¤ì CSS ì½ëë ì½í ì¸ ë¸ë¡ì ê°ì¸ë, ê³ ì ì ì¸ ì쪽 ì¬ì´ëë° ë ì´ììì ë§ëëë¤. Flexible Box Layout 모ëì´ ìëì¼ë¡ 모ë ë¸ë¡ì ëì´ë¥¼ ëì¼íê² íë©° ê°ë¥í ê°ë¡ì¶ ê³µê°ì 모ë ë¶ë°°í©ëë¤.
main {
display: flex;
text-align: center;
}
main > article {
flex: 1;
order: 2;
}
main > nav {
width: 200px;
order: 1;
}
main > aside {
width: 200px;
order: 3;
}
ê²°ê³¼
ì ê·¼ì± ê³ ë ¤ì¬í
order ìì±ì ì¬ì©íë©´ ì¤ì DOM ììì íë©´ì ë³´ì¬ì§ë ì½í
ì¸ ì ììê° ìë¡ ì°ê²°ëì§ ììµëë¤. ì´ë ë®ì ìê°ì¼ë¡ ì¤í¬ë¦° 리ë ë± ë³´ì¡° 기ì ì ì¬ì©í´ ì´ëíë ì¬ì©ìì ê²½íì ë¶ì ì ì¸ ìí¥ì ì¤ ì ììµëë¤. ìê°ì ìì(CSS)ê° ì¤ìíëë¼ë ì¤í¬ë¦° 리ë ì¬ì©ìë ì ëë¡ ë ì½ê¸° ìì를 ì ì ììµëë¤.
ëª ì¸
| Specification |
|---|
| CSS Display Module Level 3 > # order-property > |
| ì´ê¸°ê° | 0 |
|---|---|
| ì ì©ëì | Flex items, grid items, and absolutely-positioned flex and grid container children |
| ìì | no |
| ê³ì° ê° | as specified |
| Animation type | an integer |
ë¸ë¼ì°ì í¸íì±
ê°ì´ 보기
- CSS íë ì¤ë°ì¤ ìë´ì: íë ì¤ë°ì¤ì 기본 ê°ë
- CSS íë ì¤ë°ì¤ ìë´ì: íë ì¤ ìì´í ì ìì ì í기
- CSS 그리ë ìë´ì: CSS 그리ë ë ì´ììê³¼ ì ê·¼ì±