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

質問編集履歴

3

画像の追加

2021/04/10 03:17

投稿

_li____nu
_li____nu

スコア4

title CHANGED
File without changes
body CHANGED
@@ -5,6 +5,7 @@
5
5
  クラス名 contents-2 の子要素にしたいもの(クラス名:contents-2a、txt-2a、white の3つの要素)の、親が contents-1 になっているようです。
6
6
 
7
7
  希望の形としては、
8
+ ![イメージ説明](f9610b90eb7289149030aa512a62fa80.png)
8
9
  親:contents-1(relative)
9
10
  子:contents-1a、txt-1a、contents-1b、txt-1b(absolute)
10
11
  のブロックと
@@ -87,7 +88,7 @@
87
88
  width: 600px;
88
89
  height: 600px;
89
90
  position: absolute;
90
- top: 1400px;
91
+ top: 20px;
91
92
  left: 480px;
92
93
  background: #fff;
93
94
  z-index: 10;
@@ -127,14 +128,14 @@
127
128
 
128
129
  .contents-2a {
129
130
  position: absolute;
130
- top: 1300px;
131
+ top: 0px;
131
132
  left: 50px;
132
133
  }
133
134
 
134
135
  .txt-2a {
135
136
  position: absolute;
136
137
  text-align: left;
137
- top: 1450px;
138
+ top: 50px;
138
139
  left: 530px;
139
140
  z-index: 20;
140
141
  }

2

文章の修正

2021/04/10 03:17

投稿

_li____nu
_li____nu

スコア4

title CHANGED
File without changes
body CHANGED
@@ -4,6 +4,16 @@
4
4
 
5
5
  クラス名 contents-2 の子要素にしたいもの(クラス名:contents-2a、txt-2a、white の3つの要素)の、親が contents-1 になっているようです。
6
6
 
7
+ 希望の形としては、
8
+ 親:contents-1(relative)
9
+ 子:contents-1a、txt-1a、contents-1b、txt-1b(absolute)
10
+ のブロックと
11
+
12
+ 親:contents-2(relative)
13
+ 子:contents-2a、txt-2a、white(absolute)
14
+ のブロックにしたいと思っているのですが、positionの理解が間違っているでしょうか…?
15
+
16
+
7
17
  Googleで検索したところ、「親要素は直前のものになる」とあったので、
8
18
  その理屈でいくと この書き方であっているのかな?と思ったのですが、
9
19
  どうしてもうまくいかず、こちらで質問させていただきました。

1

文章の修正・追記

2021/04/10 02:48

投稿

_li____nu
_li____nu

スコア4

title CHANGED
File without changes
body CHANGED
@@ -2,7 +2,7 @@
2
2
  各ブロックごとに contents-1 / contents-2 を親要素、
3
3
  その中身の div を子要素として、position: relative; / position: absolute;を用いてページレイアウトをしたいのですが、
4
4
 
5
- クラス名 contents-2 の子要素にしたいものの、親が contents-1 になっているようです。
5
+ クラス名 contents-2 の子要素にしたいもの(クラス名:contents-2a、txt-2a、white 3つの要素)の、親が contents-1 になっているようです。
6
6
 
7
7
  Googleで検索したところ、「親要素は直前のものになる」とあったので、
8
8
  その理屈でいくと この書き方であっているのかな?と思ったのですが、