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

質問編集履歴

1

cssの追加 markdownの利用

2021/10/09 02:58

投稿

maruco2525
maruco2525

スコア3

title CHANGED
File without changes
body CHANGED
@@ -1,6 +1,7 @@
1
1
  html、cssでコーディングを行い、レスポンシブ対応もしているのですが、スマホサイズにしたときに右側に余白ができ、左右のスクロールバーができてしまいます。
2
2
  色々試しましたが原因が分からないので教えていただけないでしょうか?
3
- html
3
+ ```html
4
+
4
5
  <div id="wrapper">
5
6
  <header>
6
7
  <div class="header_inner main_bg_img">
@@ -32,7 +33,7 @@
32
33
  </div>
33
34
  <div class="top_message">
34
35
  <p class="main_message">Design for Smile.</p>
35
- <p class="sub_message">快適なオフィスを<span>デザインする</span></p>
36
+ <p class="sub_message"><span></span></p>
36
37
  </div>
37
38
  </div>
38
39
 
@@ -43,16 +44,13 @@
43
44
  <h2>CONCEPT</h2>
44
45
  </div>
45
46
  <P class="concept_message">
46
- "働きたくなる空間"をデザインすることで<br>
47
+
47
- 人々を幸せにする。
48
48
  </P>
49
49
  <div class="concept_contents">
50
50
  <p class="concept_explanation">
51
- 私たちは、オフィスに特化した空間デザイン専門としております。その理由は、「働きたくなる空間で仕事ができれば
51
+
52
- 多くの人を幸せにできるのではないか」と考えるためです。そんな想いの株式会社Cresta Designだからこそできる
53
- 空間デザインを提供させていただきます。
54
52
  </p>
55
- <img class="concept_img" src="img/concept-image@2x.jpg" alt="空間デザインイメージ写真">
53
+ <img class="concept_img" src="img/concept-image@2x.jpg" alt="">
56
54
  </div>
57
55
  <div class="light_color sentence_right">Our Concept</div>
58
56
  </article>
@@ -63,15 +61,15 @@
63
61
  <div class="works_inner">
64
62
  <dl>
65
63
  <dt><img src="img/card-img01@2x.jpg" alt="新規サイトイメージ写真"></dt>
66
- <dd>新規サイトを公開しました。今回のサイトは白と黒を基調にしたミニマルなデザインになっています。</dd>
64
+ <dd></dd>
67
65
  </dl>
68
66
  <dl>
69
67
  <dt><img src="img/card-img02@2x.jpg" alt="新規サイトイメージ写真"></dt>
70
- <dd>新規サイトを公開しました。今回のサイトは白と黒を基調にしたミニマルなデザインになっています。</dd>
68
+ <dd></dd>
71
69
  </dl>
72
70
  <dl>
73
71
  <dt><img src="img/card-img03@2x.jpg" alt="新規サイトイメージ写真"></dt>
74
- <dd>新規サイトを公開しました。今回のサイトは白と黒を基調にしたミニマルなデザインになっています。</dd>
72
+ <dd></dd>
75
73
  </dl>
76
74
  </div>
77
75
  <button><a href="#">View more</a></button>
@@ -92,14 +90,369 @@
92
90
  <div class="right_title">
93
91
  <h2>Contact</h2>
94
92
  </div>
95
- <p>お気軽にご相談ください。</p>
93
+ <p></p>
96
94
  <button><a href="#">Contact</a></button>
97
95
  <div class="light_color sentence_left">Contact us</div>
98
96
  </article>
99
97
  </section>
98
+ <footer>
99
+
100
+ </footer>
101
+ </div>
102
+ ```
103
+ ```css
100
104
 
105
+ #wrapper {
106
+ width: 100%;
107
+ }
101
108
 
109
+ /*ヘッダー*/
110
+ header {
111
+ width: 100%;
112
+ height: 750px;
113
+ position: relative;
114
+ }
115
+
116
+ header nav {
102
- <footer>
117
+ float: right;
118
+ }
119
+
120
+ header nav li {
121
+ display: inline-block;
122
+ padding: 5px 10px;
123
+ }
124
+
125
+ header nav li a {
126
+ font-size: 81%;
127
+ display: block;
128
+ border-bottom: 1px solid #333;
129
+ }
130
+
131
+
132
+ header .main_name {
133
+ font-size: 225%;
134
+ position: absolute;
135
+ top: 50%;
136
+ transform: translate(-50%);
137
+ z-index: 20;
138
+ left: 50%;
139
+ }
140
+
141
+ header .sub_name {
142
+ font-size: 10vw;
143
+ position: absolute;
144
+ top: 50%;
145
+ transform: translateY(-50%);
146
+ z-index: 10;
147
+ left: 50%;
148
+ }
149
+
150
+ /*article共通*/
151
+ article {
152
+ padding: 50px 30px;
153
+ width: 100%;
154
+ box-sizing: border-box;
155
+ }
156
+
157
+ article h2 {
158
+ font-size: 187%;
159
+ margin-bottom: 20px;
160
+ font-weight: bold;
161
+ }
162
+
163
+ article h2 span {
164
+ font-size: 80%;
165
+ display: block;
166
+ }
167
+
168
+ /*プロフィール*/
169
+ #profile {
170
+ margin-bottom: 50px;
171
+ }
172
+
173
+ #profile .profile_inner {
174
+ display: flex;
175
+ align-items: center;
176
+ }
177
+
178
+ #profile .profile_inner .profile_image {
179
+ width: 50vw;
180
+ }
181
+
182
+ #profile .profile_inner span {
183
+ display: block;
184
+ padding-left: 20px;
185
+ margin-bottom: 10px;
186
+ }
187
+
188
+ #profile .profile_inner .profile_sentence {
189
+ width: 50vw;
190
+ }
191
+
192
+ #profile .profile_inner .profile_sentence p {
193
+ padding-left: 20px;
194
+ text-align: justify;
195
+ line-height: 1.8em;
196
+ }
197
+
198
+ /*制作物*/
199
+ #works {
200
+ width: 100%;
201
+ margin-bottom: 50px;
202
+ /*キャンプ場hp*/
203
+ /*cresta design hp*/
204
+ }
205
+
206
+ #works h3 {
207
+ font-size: 112%;
208
+ margin-bottom: 20px;
209
+ }
210
+
211
+
212
+
213
+
214
+ #works dl dd {
215
+ padding: 10px 1em;
216
+ text-indent: 1em;
217
+ }
218
+
219
+ #works button {
220
+ background-color: #7fd1b9;
221
+ border: none;
222
+ border-radius: 10px;
223
+ float: right;
224
+ padding: 0;
225
+ }
226
+
227
+ #works button a {
228
+ padding: 5px 20px;
229
+ display: block;
230
+ }
231
+
232
+
233
+
234
+ #works .camp_hp, #works .cresta_hp {
235
+ display: flex;
236
+ margin-bottom: 50px;
237
+ }
238
+
239
+ #works .camp_hp ul li:nth-of-type(1) img, #works .cresta_hp ul li:nth-of-type(1) img {
240
+ width: 25vw;
241
+ }
242
+
243
+ #works .camp_hp ul li:nth-of-type(2), #works .cresta_hp ul li:nth-of-type(2) {
244
+ margin: 10% 0 0 10vw;
245
+ }
246
+
247
+ #works .camp_hp ul li:nth-of-type(2) img, #works .cresta_hp ul li:nth-of-type(2) img {
248
+ width: 5vw;
249
+ }
250
+
251
+ #works .camp_hp .camp_explanation, #works .camp_hp .cresta_explanation, #works .cresta_hp .camp_explanation, #works .cresta_hp .cresta_explanation {
252
+ width: 70vw;
253
+ padding: 5px 0 0 50px;
254
+ }
255
+
256
+ #works .cresta_explanation dd span {
257
+ display: block;
258
+ font-size: 75%;
259
+ }
260
+
261
+
262
+
263
+ #works .cresta_explanation dd span:nth-of-type(1) {
264
+ margin-top: 2em;
265
+ }
266
+
267
+ /*できること*/
268
+ #skills {
269
+ margin: 0 auto 40px;
270
+ }
271
+
272
+ #skills .skills_inner {
273
+ display: flex;
274
+ flex-wrap: wrap;
275
+ }
276
+
277
+ #skills .skills_inner dl {
278
+ width: 400px;
279
+ margin-bottom: 40px;
280
+ }
281
+
282
+ #skills .skills_inner dl dt {
283
+ font-weight: bold;
284
+ margin-top: 5px;
285
+ margin-bottom: 20px;
286
+ }
287
+
288
+ #skills .skills_inner dl .fab {
289
+ font-size: 300%;
290
+ }
291
+
103
- <p>&copy;cresta.design all rights reserved</p>
292
+ #skills .skills_inner dl .ps_icon, #skills .skills_inner dl .ai_icon {
293
+ width: 40px;
294
+ height: 40px;
295
+ text-align: right;
296
+ line-height: 56px;
297
+ margin-bottom: 13px;
298
+ }
299
+ responsive css
300
+
301
+ @media screen and (min-width: 599px) {
302
+ #hamburger_menu {
303
+ display: none;
304
+ }
305
+ }
306
+ @media screen and (max-width: 599px) {
104
- </footer>
307
+ /*ヘッダー*/
308
+ .header_inner {
309
+ /*ハンバーガーメニュー*/
310
+ }
311
+ .header_inner #header_fixed {
312
+ width: 100%;
313
+ }
314
+ .header_inner h1 {
315
+ padding-left: 2%;
316
+ }
317
+ .header_inner #nav_menu {
318
+ padding-right: 0;
319
+ display: none;
320
+ }
321
+ .header_inner .top_message {
322
+ width: 100%;
323
+ padding-left: 0;
324
+ padding-top: 154px;
325
+ }
326
+ .header_inner .top_message .main_message {
327
+ font-size: 37px;
328
+ width: 100%;
329
+ text-align: center;
330
+ margin-bottom: 20px;
331
+ }
332
+ .header_inner .top_message .sub_message {
333
+ font-size: 30px;
334
+ line-height: 1.8em;
335
+ }
336
+ .header_inner .top_message span {
337
+ display: block;
338
+ font-weight: bold;
339
+ }
340
+ .header_inner #hamburger_menu {
341
+ position: absolute;
342
+ top: 0;
343
+ right: -110%;
344
+ width: 100%;
345
+ height: 100vh;
346
+ background-color: #282F35;
347
+ transition: .7s;
348
+ }
349
+ .header_inner #hamburger_menu ul {
350
+ margin: 50vh auto 0;
351
+ transform: translateY(-50%);
352
+ text-align: center;
353
+ }
354
+ .header_inner #hamburger_menu ul li a {
355
+ color: #fff;
356
+ display: block;
357
+ padding: 10px;
358
+ translate: .5s;
359
+ }
360
+
361
+ .header_inner #hamburger {
362
+ display: block;
363
+ position: absolute;
364
+ width: 30px;
365
+ height: 22px;
366
+ top: 30px;
367
+ right: 30px;
368
+ transition: 1s;
369
+ }
370
+ .header_inner #hamburger .inner_line {
371
+ display: block;
372
+ position: absolute;
373
+ width: 30px;
374
+ height: 3px;
375
+ background-color: #fff;
376
+ transition: 1s;
377
+ transform-origin: 28px;
378
+ }
379
+ .header_inner #hamburger #line_top {
380
+ top: 0;
381
+ }
382
+ .header_inner #hamburger #line_middle {
383
+ top: 10px;
384
+ }
385
+ .header_inner #hamburger #line_bottom {
386
+ bottom: 0;
387
+ }
388
+ .header_inner .top_move {
389
+ transform: rotate(-45deg);
390
+ top: 50%;
391
+ }
392
+ .header_inner .middle_move {
393
+ opacity: 0;
394
+ }
395
+ .header_inner .bottom_move {
396
+ transform: rotate(45deg);
397
+ bottom: 0;
398
+ }
399
+ .header_inner .in {
400
+ transform: translateX(-110%);
401
+ }
402
+ article .left_title {
403
+ padding-left: 0;
404
+ }
405
+ article h2 {
406
+ font-size: 30px;
407
+ }
408
+ article h2::after {
409
+ width: 90px;
410
+ }
411
+
412
+ /*コンセプト*/
413
+ #concept {
414
+ padding: 0 10px;
415
+ }
416
+ #concept .concept_contents {
417
+ flex-direction: column;
418
+ width: 100%;
419
+ margin: 0 auto 55px;
420
+ justify-content: center;
421
+ }
422
+ #concept .concept_contents .concept_explanation {
423
+
424
+ width: 100%;
425
+ }
426
+ #concept .concept_message {
427
+ width: 100%;
428
+ margin: 0 auto 34px;
429
+ }
430
+ #concept img {
431
+ width: 100vw;
432
+ height: auto;
433
+ }
105
- </div>
434
+ /*ワークス*/
435
+ #works .works_inner {
436
+ flex-direction: column;
437
+ }
438
+ #works dl {
439
+ margin: 0;
440
+ }
441
+
442
+ /*サービス*/
443
+ #service h2 {
444
+ padding-left: 6%;
445
+ text-align: left;
446
+ }
447
+ #service ul {
448
+ flex-direction: column;
449
+ align-items: center;
450
+ }
451
+ #service ul li {
452
+ width: 100%;
453
+ }
454
+
455
+
456
+
457
+ }
458
+ ``````