質問編集履歴

4

PC版の画像の追記

2020/09/09 20:14

投稿

takawork
takawork

スコア95

test CHANGED
File without changes
test CHANGED
@@ -1,3 +1,9 @@
1
+ PC版
2
+
3
+ ![イメージ説明](447a11588f14a83d3aad5d70b3a7c2f7.png)
4
+
5
+ スマホ版
6
+
1
7
  ![![イメージ説明](a667573d88f4b6f957a8bad1a182c9e1.png)](30c23bc01697a24f49c2e392c836fc7b.png)
2
8
 
3
9
 
@@ -6,9 +12,9 @@
6
12
 
7
13
  ヘッダーの下にメインコンテンツをおきたいのですが、大きめの隙間が出来てしまいます。
8
14
 
9
- 大きさ調べると、「あ」のところまでに、.topbarbgクスがあ検証モードで出たので、
15
+ 検証モードで隙間ると、topbarbgと表示されたので、PC版のロゴの背景のボックス要素?消えていにんだ思います。
10
-
16
+
11
- それをdisplay:none;で消したらメニューの方が消えてしまいました。
17
+ 自分ではdisplay:none;で消したらスマホ版メニューが消えてしまいました。
12
18
 
13
19
  どうすればヘッダーの下にディスプレイをおくことが出来ますでしょうか?
14
20
 

3

全体のcssの追記

2020/09/09 20:14

投稿

takawork
takawork

スコア95

test CHANGED
File without changes
test CHANGED
@@ -228,6 +228,164 @@
228
228
 
229
229
  ```
230
230
 
231
+ 全体のcssです。
232
+
233
+ ```
234
+
235
+ body {
236
+
237
+ background-color: #f5f5f5;
238
+
239
+ }
240
+
241
+
242
+
243
+ .headerwp {
244
+
245
+ max-width: 1200px;
246
+
247
+ margin: 0 auto;
248
+
249
+ padding: 0px;
250
+
251
+ min-width: 320px;
252
+
253
+ }
254
+
255
+
256
+
257
+ .topbarbg {
258
+
259
+ width: 100%;
260
+
261
+ display: block;
262
+
263
+ min-height: 214px;
264
+
265
+ padding-top: 0px;
266
+
267
+ background: url(../images/topbg.jpg) top center no-repeat;
268
+
269
+ box-shadow: 0 0 20px rgba(0, 0, 0, .3);
270
+
271
+ }
272
+
273
+
274
+
275
+ .desktoplogo {
276
+
277
+ padding: 49px 0px;
278
+
279
+ margin: 0 auto;
280
+
281
+ text-align: center;
282
+
283
+ }
284
+
285
+ .desktoplogo img{
286
+
287
+ width:300px;
288
+
289
+ }
290
+
291
+
292
+
293
+
294
+
295
+
296
+
297
+
298
+
299
+ @media only screen and (min-width: 230px) and (max-width:991px) {
300
+
301
+ .desktoplogo {
302
+
303
+ display: none;
304
+
305
+ }
306
+
307
+
308
+
309
+ .topbarbg {
310
+
311
+ background: none;
312
+
313
+ box-shadow: none;
314
+
315
+ }
316
+
317
+
318
+
319
+ .swichermainbx {
320
+
321
+ width: 96%;
322
+
323
+ margin: 0% 2%;
324
+
325
+ display: block;
326
+
327
+ background-color: rgba(255, 255, 255, 0.3);
328
+
329
+ padding: 15px 25px;
330
+
331
+ border-radius: 14px;
332
+
333
+ }
334
+
335
+
336
+
337
+ .swichermainleft {
338
+
339
+ width: 98%;
340
+
341
+ margin: 1% 1%;
342
+
343
+ }
344
+
345
+
346
+
347
+ .swichermainright {
348
+
349
+ width: 98%;
350
+
351
+ margin: 1% 1%;
352
+
353
+ }
354
+
355
+
356
+
357
+ .wscolorcode {
358
+
359
+ width: 12.5%;
360
+
361
+ }
362
+
363
+
364
+
365
+ .swichertxt {
366
+
367
+ display: none;
368
+
369
+ }
370
+
371
+
372
+
373
+ .swichertxt02 span {
374
+
375
+ display: none;
376
+
377
+ }
378
+
379
+
380
+
381
+ }
382
+
383
+ ```
384
+
385
+
386
+
387
+
388
+
231
389
  ↓メニューだけのcssです。
232
390
 
233
391
  css1つ目

2

cssとjqueryの追加

2020/09/09 19:25

投稿

takawork
takawork

スコア95

test CHANGED
File without changes
test CHANGED
@@ -80,154 +80,160 @@
80
80
 
81
81
  ```
82
82
 
83
- body {
84
-
85
- background-color: #f5f5f5;
86
-
87
- }
88
-
89
-
90
-
91
- .headerwp {
92
-
93
- max-width: 1200px;
94
-
95
- margin: 0 auto;
96
-
97
- padding: 0px;
98
-
99
- min-width: 320px;
100
-
101
- }
102
-
103
-
104
-
105
- .topbarbg {
106
-
107
- width: 100%;
108
-
109
- display: block;
110
-
111
- min-height: 214px;
112
-
113
- padding-top: 0px;
114
-
115
- background: url(../images/topbg.jpg) top center no-repeat;
116
-
117
- box-shadow: 0 0 20px rgba(0, 0, 0, .3);
118
-
119
- }
120
-
121
-
122
-
123
- .desktoplogo {
124
-
125
- padding: 49px 0px;
126
-
127
- margin: 0 auto;
128
-
129
- text-align: center;
130
-
131
- }
132
-
133
- .desktoplogo img{
134
-
135
- width:300px;
136
-
137
- }
138
-
139
-
140
-
141
-
142
-
143
-
144
-
145
-
146
-
147
- @media only screen and (min-width: 230px) and (max-width:991px) {
148
-
149
- .desktoplogo {
150
-
151
- display: none;
152
-
153
- }
154
-
155
-
156
-
157
- .topbarbg {
158
-
159
- background: none;
160
-
161
- box-shadow: none;
162
-
163
- }
164
-
165
-
166
-
167
-
168
-
169
- .swichermainbx {
170
-
171
- width: 96%;
172
-
173
- margin: 0% 2%;
174
-
175
- display: block;
176
-
177
- background-color: rgba(255, 255, 255, 0.3);
178
-
179
- padding: 15px 25px;
180
-
181
- border-radius: 14px;
182
-
183
- }
184
-
185
-
186
-
187
- .swichermainleft {
188
-
189
- width: 98%;
190
-
191
- margin: 1% 1%;
192
-
193
- }
194
-
195
-
196
-
197
- .swichermainright {
198
-
199
- width: 98%;
200
-
201
- margin: 1% 1%;
202
-
203
- }
204
-
205
-
206
-
207
- .wscolorcode {
208
-
209
- width: 12.5%;
210
-
211
- }
212
-
213
-
214
-
215
- .swichertxt {
216
-
217
- display: none;
218
-
219
- }
220
-
221
-
222
-
223
- .swichertxt02 span {
224
-
225
- display: none;
226
-
227
- }
228
-
229
-
230
-
231
- }
232
-
233
- ```
83
+ /* global jQuery */
84
+
85
+ /* global document */
86
+
87
+
88
+
89
+ jQuery(function () {
90
+
91
+ 'use strict';
92
+
93
+
94
+
95
+ document.addEventListener("touchstart", function () {}, false);
96
+
97
+ jQuery(function () {
98
+
99
+
100
+
101
+ jQuery('body').wrapInner('<div class="wsmenucontainer" />');
102
+
103
+ jQuery('<div class="overlapblackbg"></div>').prependTo('.wsmenu');
104
+
105
+
106
+
107
+ jQuery('#wsnavtoggle').click(function () {
108
+
109
+ jQuery('body').toggleClass('wsactive');
110
+
111
+ });
112
+
113
+
114
+
115
+ jQuery('.overlapblackbg').click(function () {
116
+
117
+ jQuery("body").removeClass('wsactive');
118
+
119
+ });
120
+
121
+
122
+
123
+ jQuery('.wsmenu > .wsmenu-list > li').has('.sub-menu').prepend('<span class="wsmenu-click"><i class="wsmenu-arrow"></i></span>');
124
+
125
+ jQuery('.wsmenu > .wsmenu-list > li').has('.wsmegamenu').prepend('<span class="wsmenu-click"><i class="wsmenu-arrow"></i></span>');
126
+
127
+
128
+
129
+ jQuery('.wsmenu-click').click(function () {
130
+
131
+ jQuery(this).toggleClass('ws-activearrow')
132
+
133
+ .parent().siblings().children().removeClass('ws-activearrow');
134
+
135
+ jQuery(".wsmenu > .wsmenu-list > li > .sub-menu, .wsmegamenu").not(jQuery(this).siblings('.wsmenu > .wsmenu-list > li > .sub-menu, .wsmegamenu')).slideUp('slow');
136
+
137
+ jQuery(this).siblings('.sub-menu').slideToggle('slow');
138
+
139
+ jQuery(this).siblings('.wsmegamenu').slideToggle('slow');
140
+
141
+ });
142
+
143
+
144
+
145
+ jQuery('.wsmenu > .wsmenu-list > li > ul > li').has('.sub-menu').prepend('<span class="wsmenu-click02"><i class="wsmenu-arrow"></i></span>');
146
+
147
+ jQuery('.wsmenu > .wsmenu-list > li > ul > li > ul > li').has('.sub-menu').prepend('<span class="wsmenu-click02"><i class="wsmenu-arrow"></i></span>');
148
+
149
+
150
+
151
+ jQuery('.wsmenu-click02').click(function () {
152
+
153
+ jQuery(this).children('.wsmenu-arrow').toggleClass('wsmenu-rotate');
154
+
155
+ jQuery(this).siblings('li > .sub-menu').slideToggle('slow');
156
+
157
+ });
158
+
159
+
160
+
161
+ jQuery(window).on('resize', function () {
162
+
163
+
164
+
165
+ if (jQuery(window).outerWidth() < 992) {
166
+
167
+ jQuery('.wsmenu').css('height', jQuery(this).height() + "px");
168
+
169
+ jQuery('.wsmenucontainer').css('min-width', jQuery(this).width() + "px");
170
+
171
+ } else {
172
+
173
+ jQuery('.wsmenu').removeAttr("style");
174
+
175
+ jQuery('.wsmenucontainer').removeAttr("style");
176
+
177
+ jQuery('body').removeClass("wsactive");
178
+
179
+ jQuery('.wsmenu > .wsmenu-list > li > .wsmegamenu, .wsmenu > .wsmenu-list > li > ul.sub-menu, .wsmenu > .wsmenu-list > li > ul.sub-menu > li > ul.sub-menu, .wsmenu > .wsmenu-list > li > ul.sub-menu > li > ul.sub-menu > li > ul.sub-menu').removeAttr("style");
180
+
181
+ jQuery('.wsmenu-click').removeClass("ws-activearrow");
182
+
183
+ jQuery('.wsmenu-click02 > i').removeClass("wsmenu-rotate");
184
+
185
+ }
186
+
187
+
188
+
189
+ });
190
+
191
+
192
+
193
+ jQuery(window).trigger('resize');
194
+
195
+
196
+
197
+ });
198
+
199
+
200
+
201
+ //Mobile Search Box
202
+
203
+ jQuery(window).on("load", function () {
204
+
205
+ jQuery('.wsmobileheader .wssearch').on("click", function () {
206
+
207
+ jQuery(this).toggleClass("wsopensearch");
208
+
209
+ });
210
+
211
+ jQuery("body, .wsopensearch .wscloseicon").on("click", function () {
212
+
213
+ jQuery(".wssearch").removeClass('wsopensearch');
214
+
215
+ });
216
+
217
+ jQuery(".wssearch, .wssearchform form").on("click", function (e) {
218
+
219
+ e.stopPropagation();
220
+
221
+ });
222
+
223
+ });
224
+
225
+
226
+
227
+ }());
228
+
229
+ ```
230
+
231
+ ↓メニューだけのcssです。
232
+
233
+ css1つ目
234
+
235
+ https://harigami.jp/cd?hsh=2acb3522-665d-4853-a09f-05babd9500af
236
+
237
+ css2つ目
238
+
239
+ https://harigami.jp/cd?hsh=021f80bb-7d65-4621-a21d-1e6c55672288

1

ブートストラップを使用してることの説明の追記。

2020/09/09 18:44

投稿

takawork
takawork

スコア95

test CHANGED
File without changes
test CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  どうすればヘッダーの下にディスプレイをおくことが出来ますでしょうか?
14
14
 
15
- よろしくお願いします。
15
+ ブートストラップのグリッドで作成しています。よろしくお願いします。
16
16
 
17
17
  ```
18
18