html
1コード<body> 2<div id="flex-container"> <!-- ページ全体に設定 --> 3<header> 4 <h1>flexbox</h1> 5</header> 6<nav id="top-nav"> 7 <ul > 8 <li ><a href="xxx.html">flexible-test</a></li> 9 </ul> 10</nav> 11<main> 12 <nav class="nav01"> 13 <h3>nav01</h3> 14 <ul> 15 <li><a href="xxx.html">nav01-1</a></li> 16 </ul> 17 </nav> 18 19 <section class="main-page"> 20 <article class="notes"> 21 <h3>content 1</h3> 22 <p>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</p> 23 <hr /> 24 </article> 25 <article class="notes"> 26 <h3>content 2</h3> 27 <p >xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</p> 28 <hr /> 29 </article> 30 </section> 31</main> 32</div> <!-- flex-container --> 33コード 34 35```ここに言語を入力 36コード
css3
1コード#flex-container{ 2 display:flex; 3} 4#flex-container header { 5 display:flex; 6} 7nav#top-nav ul { 8 display:flex; 9 flex-direction:column; 10} 11main { 12 display: flex; 13 flex-direction: column; 14} 15nav.nav01 { 16 order:2; 17} 18nav.nav01 ul{ 19 display:flex; /* ulをflex化 */ 20 flex-direction:column; 21} 22.main-page { 23 display:flex; 24 flex-direction:column; 25 order:-1; /* 0指定では上手く機能しない */ 26} 27 28下記などを記述してみましたが、機能しませんでした。 29#flex-container main{ 30order:-1; 31} 32他、main にクラスを設定して 33main.xxx { 34order:-1; 35} 36など 37
main 内の順番の入れ替えは上記のコードで出来ているのですが、#flex-container の子であるheader、top-nav 、main の表示順を変更するにはどのようにするといいのでしょうか?
webを自分でコードを書いてみようと思って始めたばかりで、知識不足で申し訳ありませんが、よろしくお願いいたします。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/10/31 03:07
2016/10/31 03:51
2016/10/31 04:09
2016/10/31 04:21
2016/10/31 04:28
2016/10/31 04:39
2016/10/31 04:42
2016/10/31 04:46
2016/10/31 05:36
2016/10/31 06:04
2016/10/31 06:26
2016/10/31 06:38
2016/10/31 06:39
2016/10/31 07:15
2016/10/31 07:26
2016/10/31 08:50
2016/10/31 09:02
2016/10/31 09:25
2016/10/31 09:34
2016/10/31 11:01
2016/10/31 11:21
2016/10/31 12:25
2016/10/31 13:11
2016/10/31 14:05