質問するログイン新規登録

質問編集履歴

1

コードの追加

2018/06/24 12:18

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -13,4 +13,128 @@
13
13
  子要素がabsoluteだったら、heightがなくて
14
14
  次の要素が上がってくるのはわかりますが、
15
15
  子要素がrelativeでも各子要素がheight指定がない限り
16
- 次の要素が上がってきちゃうのでしょうか?
16
+ 次の要素が上がってきちゃうのでしょうか?
17
+
18
+ 現状はなぜかsection5が勝手に上がってきてるので、
19
+ margin-topでその分入れてますが、
20
+ relativeで入れたのにmarginでそこを確保すべきなのか?
21
+ コードで間違いがあったのかなと思い、
22
+ 質問させて頂きます・・・。
23
+
24
+ ```html
25
+ <section id="section4">
26
+ <h2>Interview</h2>
27
+ <figure id="people-img">
28
+ <img src="image/index/index_img09.png">
29
+ </figure>
30
+ <div id="people-area">
31
+ <a href="#" class="pic" id="pic01">
32
+ <div class="a-hover"></div>
33
+ <p>01</p>
34
+ <div class="animated">
35
+ <img src="image/index/index_img10.png">
36
+ </div>
37
+ <div class="shadow">
38
+ <div class="shadow-in">
39
+ 一番目の人
40
+ </div>
41
+ </div>
42
+ </a>
43
+ <a href="#" class="pic" id="pic02">
44
+ <div class="a-hover"></div>
45
+ <p>02</p>
46
+ <div class="animated">
47
+ <img src="image/index/index_img11.png">
48
+ </div>
49
+ <div class="shadow">
50
+ <div class="shadow-in">
51
+ 二番目の人
52
+ </div>
53
+ </div>
54
+ </a>
55
+ <a href="#" class="pic" id="pic03">
56
+ <div class="a-hover"></div>
57
+ <p>03</p>
58
+ <div class="animated">
59
+ <img src="image/index/index_img12.png">
60
+ </div>
61
+ <div class="shadow">
62
+ <div class="shadow-in">
63
+ 三番目の人
64
+ </div>
65
+ </div>
66
+ </a>
67
+ <a href="#" class="pic" id="pic04">
68
+ <div class="a-hover"></div>
69
+ <p>04</p>
70
+ <div class="animated">
71
+ <img src="image/index/index_img13.png">
72
+ </div>
73
+ <div class="shadow">
74
+ <div class="shadow-in">
75
+ 4番目の人
76
+ </div>
77
+ </div>
78
+ </a>
79
+ </section>
80
+ <section id="section5"></section>
81
+ ```
82
+ ```css
83
+ #section4 {
84
+ width: 1220px;
85
+ margin: 0 auto;
86
+ position: relative;
87
+ padding-top: 400px;
88
+ height: auto;
89
+ }
90
+ #section4 h2 {
91
+ font-size: 11.4rem;
92
+ letter-spacing: 0.16em;
93
+ text-align: center;
94
+ position: relative;
95
+ z-index: 1010;
96
+ }
97
+ #section4 #people-area {
98
+ width: 1100px;
99
+ margin: 0 auto;
100
+ display: flex;
101
+ flex-wrap: wrap;
102
+ position: relative;
103
+ flex-direction: row;
104
+ }
105
+ #section4 #people-img {
106
+ right: 25px;
107
+ position: absolute;
108
+ z-index: 10;
109
+ top: 370px;
110
+ }
111
+ #section4 #people-area #pic01 {
112
+ position: relative;
113
+ left: 70px;
114
+ top: 280px;
115
+ }
116
+ #section4 #people-area #pic02 {
117
+ position: relative;
118
+ right: 0px;
119
+ top: 670px;
120
+ z-index: 1000;
121
+ }
122
+ #section4 #people-area #pic03 {
123
+ position: relative;
124
+ left: 10px;
125
+ top: 1120px;
126
+ }
127
+ #section4 #people-area #pic04 {
128
+ position: relative;
129
+ right: 70px;
130
+ top: 1340px;
131
+ z-index: 1000;
132
+ }
133
+ #section5 {
134
+ margin-top: 1900px;
135
+ position: relative;
136
+ background-color: #fff;
137
+ height: 986px;
138
+ width: 100%;
139
+ }
140
+ ```