質問編集履歴

7

誤字修正

2019/06/15 15:52

投稿

ttt343
ttt343

スコア13

test CHANGED
File without changes
test CHANGED
@@ -120,19 +120,27 @@
120
120
 
121
121
 
122
122
 
123
-
124
-
125
-
126
-
127
-
128
-
129
- ```
123
+ ```
130
-
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
131
- ```
133
+ ```
134
+
135
+
136
+
132
-
137
+ なんとか上記の方法で768px以下でスライドの時はside-menuと一緒に移動させることは出来たのですが、
138
+
133
-
139
+ この方法だとスライド時アイコン画像が一時的にside-menuからはみ出してしまいます。
134
-
140
+
141
+
142
+
135
- 上記が親基準にならないので同じような見た目にする為に試したこと ①
143
+ 上記同じような見た目ではみ出すことがないような配置にする為に試したこと ①
136
144
 
137
145
  id="icon"に親になる<div></div>をつけて親<div>に-paddngをつける。
138
146
 
@@ -299,3 +307,7 @@
299
307
  </body>
300
308
 
301
309
  ```
310
+
311
+
312
+
313
+ ```

6

誤字修正

2019/06/15 15:52

投稿

ttt343
ttt343

スコア13

test CHANGED
@@ -1 +1 @@
1
- webサイトでサイドメニューの下にアイコンをfixedで固定。一番下で一番下までスクロールしたらabsoluteで固定したいです
1
+ position:fixed;が親要素基準になりせん
test CHANGED
@@ -1,15 +1,47 @@
1
- webサイトでサイドメニューの下にアイコンfixedで固定。一番下でスクロールしたらabsoluteで固定したいです
1
+ サイドメニューの下にアイコン画像置きたいのですが、position:fixed;が親要素基準になりせん
2
-
3
- fixedのみだとウィンドウのwidthが768p以下になった時ウィンドウのサイズはそれ以上縮小しないようにしてるんですが、右にスクロールした時に、
4
-
5
- アイコンがサイドメニューからがはみ出して着いてきてしまうので、、
6
-
7
- ちなみにアイコンはside-menuのbottomとboder-rightの所にスペース無しでずっとくっついてないと変なアイコンになってます。
8
2
 
9
3
  よろしくお願いします。
10
4
 
11
5
 
12
6
 
7
+ ```html
8
+
9
+
10
+
11
+ <body>
12
+
13
+ <div class="side-menu" >
14
+
15
+ <nav>~</nav>
16
+
17
+ <div class="oya">
18
+
19
+ <div id="icon"><img></div>
20
+
21
+ </div></div>
22
+
23
+
24
+
25
+ </div>
26
+
27
+ <div id="main">
28
+
29
+ </div>
30
+
31
+ <div id="clear"></div>
32
+
33
+ </body>
34
+
35
+ ```
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
13
45
  ```css
14
46
 
15
47
  body{height:3100px;}
@@ -62,6 +94,112 @@
62
94
 
63
95
 
64
96
 
97
+ .oya{margin:0 auto;width:1px;height:1px;}
98
+
99
+
100
+
101
+ #iconyo img{z-index: 9000;}
102
+
103
+
104
+
105
+ #iconyo{bottom:-2px;margin-left:20px ;position:fixed;width: 114px;height: 171px;left: auto; z-index: 9000;padding:0;}
106
+
107
+
108
+
109
+ @media screen and (max-width:1080px) {
110
+
111
+ #iconyo img{width:80%;height:80%; }
112
+
113
+ }
114
+
115
+ @media screen and (max-width:768px) {
116
+
117
+ #iconyo {margin-left:-16px ;}
118
+
119
+ }
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+ ```
130
+
131
+ ```
132
+
133
+
134
+
135
+ 上記が親基準にならないので同じような見た目にする為に試したこと ①
136
+
137
+ id="icon"に親になる<div></div>をつけて親<div>に-paddngをつける。
138
+
139
+ ```
140
+
141
+
142
+
143
+ ```
144
+
145
+ 試したこと ②
146
+
147
+ 途中までfixed一番下までスクロールしたら absoluteにjavascriptで切り替え
148
+
149
+
150
+
151
+ css
152
+
153
+ body{height:3100px;}
154
+
155
+
156
+
157
+ @media screen and (max-width:1080px) {
158
+
159
+ body{ height: 2860px;}
160
+
161
+ }
162
+
163
+
164
+
165
+ @media screen and (max-width:800px) {
166
+
167
+ body{ height: 2600px;}
168
+
169
+ }
170
+
171
+
172
+
173
+ .side-menu{bottom:-2px;margin-left:44px;z-index:2;position:fixed;}
174
+
175
+
176
+
177
+ @media screen and (max-width:1080px) {
178
+
179
+ .side-menu{width:140px;}
180
+
181
+ }
182
+
183
+
184
+
185
+ @media screen and (max-width:800px) {
186
+
187
+ .side-menu{ width:110px;}
188
+
189
+ }
190
+
191
+
192
+
193
+ @media screen and (max-width:768px) {
194
+
195
+ .side-menu{ width:107px; }
196
+
197
+ }
198
+
199
+
200
+
201
+
202
+
65
203
  .icon img{bottom:0px;margin-left:44px;z-index:2;position:fixed;}
66
204
 
67
205
 
@@ -161,23 +299,3 @@
161
299
  </body>
162
300
 
163
301
  ```
164
-
165
-
166
-
167
-
168
-
169
- ```
170
-
171
- 試したこと
172
-
173
- 1 id="icon"に親になる<div></div>をつけて親<div>に-paddngをつける。
174
-
175
- 2 .icon imgをpostion:stickyにする。
176
-
177
- 3 親要素をmargin:0 auto;width:1px;height:1px;にして子要素をposition:fixed;left:auto;
178
-
179
-
180
-
181
-
182
-
183
- ```

5

誤字修正

2019/06/15 14:12

投稿

ttt343
ttt343

スコア13

test CHANGED
File without changes
test CHANGED
@@ -174,7 +174,7 @@
174
174
 
175
175
  2 .icon imgをpostion:stickyにする。
176
176
 
177
- 3 親要素をmargin:0 auto;にして子要素をposition:fixed;left:auto;
177
+ 3 親要素をmargin:0 auto;width:1px;height:1px;にして子要素をposition:fixed;left:auto;
178
178
 
179
179
 
180
180
 

4

誤字修正

2019/06/15 11:58

投稿

ttt343
ttt343

スコア13

test CHANGED
File without changes
test CHANGED
File without changes

3

誤字修正

2019/06/15 11:43

投稿

ttt343
ttt343

スコア13

test CHANGED
File without changes
test CHANGED
@@ -166,10 +166,18 @@
166
166
 
167
167
 
168
168
 
169
+ ```
169
170
 
170
-
171
- ####試したこと
171
+ 試したこと
172
172
 
173
173
  1 id="icon"に親になる<div></div>をつけて親<div>に-paddngをつける。
174
174
 
175
175
  2 .icon imgをpostion:stickyにする。
176
+
177
+ 3 親要素をmargin:0 auto;にして子要素をposition:fixed;left:auto;
178
+
179
+
180
+
181
+
182
+
183
+ ```

2

誤字修正

2019/06/15 11:08

投稿

ttt343
ttt343

スコア13

test CHANGED
File without changes
test CHANGED
@@ -62,7 +62,7 @@
62
62
 
63
63
 
64
64
 
65
- .icon{bottom:0px;margin-left:44px;z-index:2;position:fixed;}
65
+ .icon img{bottom:0px;margin-left:44px;z-index:2;position:fixed;}
66
66
 
67
67
 
68
68
 
@@ -161,3 +161,15 @@
161
161
  </body>
162
162
 
163
163
  ```
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+ ####試したこと
172
+
173
+ 1 id="icon"に親になる<div></div>をつけて親<div>に-paddngをつける。
174
+
175
+ 2 .icon imgをpostion:stickyにする。

1

誤字修正

2019/06/14 12:42

投稿

ttt343
ttt343

スコア13

test CHANGED
File without changes
test CHANGED
@@ -1,8 +1,8 @@
1
- webサイトでサイドメニューのサイドメニューの下にアイコンをfixedで固定。一番下まで一番下までスクロールしたらabsoluteで固定したいです。
1
+ webサイトでサイドメニューの下にアイコンをfixedで固定。一番下までスクロールしたらabsoluteで固定したいです。
2
2
 
3
- fixedのみだとウィンドウのwidthが一定のサイズ以下になった時ウィンドウのサイズはそれ以上小さくらないようにしてるんですが、右にスクロールした時に、
3
+ fixedのみだとウィンドウのwidthが768p以下になった時ウィンドウのサイズはそれ以上ないようにしてるんですが、右にスクロールした時に、
4
4
 
5
- アイコンがサイドメニューからいてきてしまうので、、
5
+ アイコンがサイドメニューからがはみ出して着いてきてしまうので、、
6
6
 
7
7
  ちなみにアイコンはside-menuのbottomとboder-rightの所にスペース無しでずっとくっついてないと変なアイコンになってます。
8
8