回答編集履歴

1

解決策が見つかった

2017/08/03 16:50

投稿

Tak1016
Tak1016

スコア1408

test CHANGED
@@ -1,5 +1,89 @@
1
+ やっつけだけどやってみた。
2
+
3
+ 背景となるdivの塊とセンタリングするABCの塊を定義
4
+
1
- Aの左側の可変幅とB,Cそれぞれの右側の可変幅はdivなどの要素ある必要がありますか?
5
+ それらをpostion :absolute z-index指定で重ねた
2
6
 
3
7
 
4
8
 
9
+ ```html
10
+
11
+ <html>
12
+
13
+ <body>
14
+
15
+ <div class="lr large-h">
16
+
17
+ <div class="left large-h"></div>
18
+
5
- 要素にする場合、javascriptで幅計算しないと不可能じゃないかなと思いました。
19
+ <div class="right large-h">
20
+
21
+ <div class="b-right small-h"></div>
22
+
23
+ <div class="c-right small-h"></div>
24
+
25
+ </div>
26
+
27
+ </div>
28
+
29
+ <div class="abc-parent">
30
+
31
+
32
+
33
+ <div class="abc middle-w large-h">
34
+
35
+ <div class="a large-w large-h"></div>
36
+
37
+ <div class="bc small-w large-h">
38
+
39
+ <div class="b small-w small-h"></div>
40
+
41
+ <div class="c small-w small-h"></div>
42
+
43
+ </div>
44
+
45
+ </div>
46
+
47
+ </div>
48
+
49
+
50
+
51
+ <style>
52
+
53
+ .abc-parent { width:100%; position: absolute;}
54
+
55
+ .abc { margin: 0 auto; z-index: -1000;}
56
+
57
+ .lr { width:100%; position: absolute;}
58
+
59
+ .a {background-color: #666;}
60
+
61
+ .b {background-color:#aabbcc;}
62
+
63
+ .c {background-color:#ccbbaa;}
64
+
65
+ .a,.bc{ float:left;}
66
+
67
+ .b-right { width: 100%; background-color: green;}
68
+
69
+ .c-right { width: 100%; background-color: yellow;}
70
+
71
+ .left { width: 50%; float: left; background-color: red;}
72
+
73
+ .right { width: 50% float: left; background-color: blue;}
74
+
75
+ .large-w { width:200px;}
76
+
77
+ .large-h { height:200px;}
78
+
79
+ .middle-w { width:300px;}
80
+
81
+ .small-w { width:100px; }
82
+
83
+ .small-h { height:100px;}
84
+
85
+ </style>
86
+
87
+ </body>
88
+
89
+ ```