html
1 2 3 <div class="box"> 4 <div class="a"> 5 a 6 </div> 7 <div class="b">b</div> 8 </div> 9 10 <div class="box2"> 11 <div class="c"> 12 c 13 </div> 14 <div class="d">d</div> 15 </div> 16 17 18
css
1 2.box { 3 background: red; 4 width: 100%; 5 height: 200px; 6 position: absolute; 7 color: #fff 8} 9 10.a { 11 background: #333; 12 width: 100%; 13 margin-left: -100px 14} 15 16.b { 17 background: #999; 18 width: 100%; 19 margin-left: 100px 20} 21 22 23.box2 { 24 writing-mode: vertical-rl; 25 color: #000; 26 background: blue; 27 width: 100%; 28 position: relative 29} 30 31.c { 32 background: #999 33} 34 35
box2に position: relativeをすると上に位置したのですが。 box2がstaticの状態だと上の要素にabusolute指定したものが上に優先的に配置されるということでしょうか。
通常後続の要素が上の要素と重なると上に配置されるはずだと思いますが。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。