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

質問編集履歴

2

コード追加

2020/10/17 15:54

投稿

Larkiwing
Larkiwing

スコア120

title CHANGED
File without changes
body CHANGED
@@ -1,6 +1,3 @@
1
- ![イメージ説明](6fd8c0b699d5d8173b6e4736b02208e2.png)footerの部分を作っているのですが、なぜか画面幅が合いません。
2
- ちょっとだけ右にずれてしまっているのですが、何がいけないのかわかる方回答をお願いします。
3
-
4
1
  ```html
5
2
  <!doctype html>
6
3
  <html lang="ja">
@@ -8,92 +5,266 @@
8
5
  <!-- Required meta tags -->
9
6
  <meta charset="utf-8">
10
7
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
11
-
12
8
  <!-- Bootstrap CSS -->
13
9
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
14
-
15
10
  <link rel="stylesheet" href="style.css">
16
- <title>Title</title>
11
+ <title>tit</title>
17
-
18
-
19
12
  </head>
20
13
  <body>
14
+
15
+
16
+ <div class="breadcrumb bg-white">
17
+ Home > Services > Strategy Consulting
18
+ </div>
19
+ <div class="category-title text-center">
20
+ Strategy Consulting
21
+ </div>
22
+ <div class="row mb-5">
23
+ <div class="col-lg-5 about-us">
24
+ <p class="">“Lorem ipsum dolor sit.</p>
25
+ <p>“Lorem ipsum dolor sit</p>
26
+ <p class="strategy-title">What </p>
27
+ <p class="list"> ✓ Lorem </p>
28
+ <p class="list"> ✓ Lorem </p>
29
+
30
+ </div>
31
+ <div class="col-lg-7 about-us-pic">
32
+ <div class="circle" href="~">
33
+ <span>1<br>sample</span>
34
+ </div>
35
+ </div>
36
+ </div>
21
37
  <footer class="footer m-2">
22
- <div class="footer-block">
23
- <div class="row">
24
- <!-- Footer Location-->
25
- <div class="col-lg-4">
26
- <p class="company-name">hogehogehogehogehogehohoge Ltd.</p>
27
- <p class="company-address">
28
- 1111 1111 1111
29
- <br />
30
- hoge hoge hoge hoge
31
- <br />
32
- hoge hogehogehoge
33
- </p>
34
- </div>
35
- <!-- Footer Logo-->
36
- <div class="col-lg-4 footer-logo">
37
- <a href="#"><img class="logo-image" src="img/logo-bottom.jpg" alt=""></a>
38
- </div>
39
- <!-- Footer About Text-->
40
- <div class="col-lg-4 company-right">
41
- <p class="company-name">© 2020 hogehoge copyright Ltd.</p>
42
- <p class="contact-details">
43
- <a href="#" class="text-dark">Email |</a>
44
- <a href="#" class="text-dark">Phone | </a>
45
- <a href="#" class="text-dark">Facebook</a> <br>
46
- <a href="#" class="text-dark">Subscribe Newsletter</a>
47
- </p>
48
- </div>
49
- </div>
50
- </div>
51
- </footer>
52
-
53
-
54
-
55
- <!-- Optional JavaScript -->
56
- <!-- jQuery first, then Popper.js, then Bootstrap JS -->
57
- <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
58
- <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
59
- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
60
-
61
-
62
-
63
- <script type="text/javascript" src="javascript.js"></script>
64
-
65
- <script>
66
- $('.navbar-nav>li>a , .dropdown-menu>a').on('click', function(){
67
- if(this.id != 'navbarDropdown'){
68
- $('.navbar-collapse').collapse('hide');
69
- }
70
- });
71
- </script>
72
- </body>
38
+ <div class="footer-block">
39
+ <div class="row">
40
+ <!-- Footer Location-->
41
+ <div class="col-lg-4">
42
+ <p class="company-name">company name</p>
43
+ <p class="company-address">
44
+ address
45
+ <br />
46
+ address
47
+ <br />
48
+ address
49
+ </p>
50
+ </div>
51
+ <!-- Footer Logo-->
52
+ <div class="col-lg-4 footer-logo">
53
+ <a href="#"><img class="logo-image" src="img/logo-bottom.jpg" alt=""></a>
54
+ </div>
55
+ <!-- Footer About Text-->
56
+ <div class="col-lg-4 company-right">
57
+ <p class="company-name">copy right</p>
58
+ <p class="contact-details">
59
+ <a href="#" class="text-dark">Email |</a>
60
+ <a href="#" class="text-dark">Phone | </a>
61
+ <a href="#" class="text-dark">Facebook</a> <br>
62
+ <a href="#" class="text-dark">Subscribe Newsletter</a>
63
+ </p>
64
+ </div>
65
+ </div>
66
+ </div>
67
+ </footer>
68
+ </body>
69
+ <!-- Optional JavaScript -->
70
+ <!-- jQuery first, then Popper.js, then Bootstrap JS -->
71
+ <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
72
+ <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
73
+ <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
74
+ <script type="text/javascript" src="javascript.js"></script>
75
+ <script>
76
+ $('.navbar-nav>li>a , .dropdown-menu>a').on('click', function(){
77
+ if(this.id != 'navbarDropdown'){
78
+ $('.navbar-collapse').collapse('hide');
79
+ }
80
+ });
81
+ </script>
82
+ </body>
73
83
  </html>
74
84
  ```
75
85
 
76
86
  ```CSS
77
87
 
88
+ .navbar {
89
+ position: relative;
90
+ z-index: 1;
91
+ }
92
+
93
+ .logo-img {
94
+ width: 15vw;
95
+ }
96
+ /* ロゴ画像レスポンシブ */
97
+ @media (max-width: 576px) {
98
+ .logo-img {
99
+ width: 60%;
100
+ }
101
+ }
102
+ .nav-link {
103
+ font-size: 1.2vw;
104
+ font-weight: bold;
105
+ line-height: 1px;
106
+ font-family: normal;
107
+ }
108
+ /* アコーディオンメニューのCSS */
109
+ @media only screen and (max-width: 991px) {
110
+ .navbar-collapse {
111
+ text-align: center;
112
+ background-color: transparent;
113
+ display : inline-block;
114
+ color : #ffffff; /* 文字の色 */
115
+ font-size : 36pt; /* 文字のサイズ */
116
+ letter-spacing : 4px; /* 文字間 */
117
+ text-shadow :
118
+ 2px 2px 1px #003366,
119
+ -2px 2px 1px #003366,
120
+ 2px -2px 1px #003366,
121
+ -2px -2px 1px #003366,
122
+ 2px 0px 1px #003366,
123
+ 0px 2px 1px #003366,
124
+ -2px 0px 1px #003366,
125
+ 0px -2px 1px #003366;
126
+ }
127
+ }
128
+ /* ふわっとヘッダー文字を表示させ切り替える時のCSS */
129
+ .fadein1 {
130
+ animation: fadein 3s ease-in-out infinite alternate both;
131
+ }
132
+ .fadein2 {
133
+ animation: fadein 3s ease-in-out 3s infinite alternate both;
134
+ }
135
+ .fadein.scrollin {
136
+ opacity: 1;
137
+ transform: translate(0, 0);
138
+ }
139
+ @keyframes fadein {
140
+ 0%{
141
+ opacity: 0;
142
+ }
143
+ 20%{
144
+ opacity: 0;
145
+ }
146
+ }
147
+ /* ヘッダー画像をnavの下に潜り込ませるCSS */
148
+
149
+ .cover-img {
150
+ height: 100%;
151
+ display: table;
152
+ width: 100%;
153
+ background-size: cover;
154
+ position: absolute;
155
+ top: 0;
156
+ left: 0;
157
+ }
158
+ .cover-img-wrapper {
159
+ height: 600px;
160
+ position: relative;
161
+ }
162
+ /* ワイドスクリーン用のCSS */
163
+
164
+ @media only screen and (min-width: 1500px) {
165
+ .cover-img-wrapper { /* 修正 */
166
+ height: 1200px;
167
+ }
168
+ }
169
+ /* タブレット用のCSS */
170
+
171
+ @media only screen and (min-width: 768px) and (max-width: 1500px) {
172
+ .cover-img-wrapper { /* 修正 */
173
+ height: 800px;
174
+ }
175
+ }
176
+ /* スマホ用のCSS */
177
+ @media only screen and (max-width: 479px) {
178
+ .cover-img-wrapper {
179
+ height: 300px;
180
+ }
181
+ }
182
+ .cover-text {
183
+ display: table-cell;
184
+ vertical-align: middle;
185
+ text-align: center;
186
+ }
187
+ .catch-copy p {
188
+ margin: 0 auto;
189
+ padding: 0 0.8em;
190
+ font-size: 3vw;
191
+ text-align: center;
192
+ }
193
+ /* スマホ用のCSS */
194
+ @media only screen and (max-width: 479px) {
195
+ .catch-copy p {
196
+ margin: 0 auto;
197
+ padding: 0 0.8em;
198
+ font-size: 3vw;
199
+ text-align: center;
200
+ }
201
+ }
202
+ .catch-copy-2 p {
203
+ margin-top: -7.2vw;
204
+ font-size: 3vw;
205
+ }
206
+ /* スマホ用のCSS */
207
+ @media only screen and (max-width: 479px) {
208
+ .catch-copy-2 p {
209
+ margin: 0 auto;
210
+ padding: 0 0.8em;
211
+ font-size: 4vw;
212
+ text-align: center;
213
+ margin-top: -40px;
214
+ }
215
+ }
216
+ .box {
217
+ display: flex;
218
+ align-items: center;
219
+ justify-content: center;
220
+ flex-direction: column;
221
+ width: 100vw;
222
+ height: 35vw;
223
+ text-align: center;
224
+ }
225
+ .box img {
226
+ opacity: 0;
227
+ transition: opacity 1s ease;
228
+ }
229
+ .box:hover img {
230
+ opacity: 1;
231
+ }
232
+ .project-image {
233
+ padding: 0;
234
+ margin: 0;
235
+ height: 100%;
236
+ width: 100%;
237
+ }
238
+ .project-category {
239
+ position: relative;
240
+ }
241
+ .project-category p {
242
+ position: absolute;
243
+ top: 50%;
244
+ left: 50%;
245
+ -ms-transform: translate(-50%,-50%);
246
+ -webkit-transform: translate(-50%,-50%);
247
+ transform: translate(-50%,-50%);
248
+ margin:0;
249
+ padding:0;
250
+ font-size: 5vw;
251
+ font-weight: 600;
252
+ }
78
253
  /* Footer */
79
254
  .footer {
80
255
  padding-top: 1rem;
81
256
  }
82
-
83
257
  .company-name {
84
258
  font-size: 1.5vw;
85
259
  font-weight: 500;
86
260
  }
87
-
88
261
  .company-address {
89
262
  font-size: 1.5vw;
90
263
  font-weight: 400;
91
264
  }
92
-
93
265
  .logo-image {
94
266
  width: 80%;
95
267
  }
96
-
97
268
  .contact-details {
98
269
  font-size: 1.2vw;
99
270
  margin-top: 60px;
@@ -102,11 +273,111 @@
102
273
  .footer-logo {
103
274
  margin-top: 100px;
104
275
  }
105
-
106
276
  .company-right {
107
277
  text-align: right;
108
278
  }
279
+ /* footerのスマホ用CSS */
280
+ @media only screen and (max-width: 992px) {
281
+ .footer-block {
282
+ text-align: center;
109
- ```
283
+ }
284
+ .company-name {
285
+ font-size: 20px;
286
+ }
287
+ .company-address {
288
+ font-size: 14px;
289
+ }
290
+ .logo-image {
291
+ width: 70%;
292
+ }
293
+ .footer-logo {
294
+ margin-top: 0px;
295
+ }
296
+ .company-right {
297
+ text-align: center;
298
+ }
299
+ .contact-details {
300
+ font-size: 14px;
301
+ margin-top: 0px;
302
+ }
303
+ }
110
304
 
305
+ .category-title {
306
+ color:#2250a2;
307
+ font-size: 3vw;
308
+ font-weight: 400;
309
+ }
310
+
311
+ .contact-description {
312
+ color:#2250a2;
313
+ font-size: 2vw;
314
+ }
315
+
316
+ .rectangle {
317
+ width: 100%;
318
+ height: 5vw;
319
+ margin: 1vw 0;
111
- 初歩的な質問ですみません。
320
+ padding: 2vw;
321
+ }
322
+
323
+ .image-bottom {
324
+ width: 100%;
325
+ }
326
+
327
+ .category-title {
328
+ margin-bottom: 4vw;
329
+ }
330
+
112
- 宜しくお願い致します。
331
+ .about-us {
332
+ padding: 0 3vw;
333
+ font-weight: 500;
334
+ font-size: 1.2vw;
335
+ }
336
+
337
+ .chairman-pic {
338
+ width: 47vw;
339
+ }
340
+
341
+ @media only screen and (max-width: 992px) {
342
+ .chairman-pic {
343
+ width: 100vw;
344
+ }
345
+ .about-us-pic {
346
+ order: 1;
347
+ }
348
+ .about-us {
349
+ order: 2;
350
+ }
351
+ }
352
+ /* スマホ用のCSS */
353
+ @media only screen and (max-width: 479px) {
354
+ .about-us {
355
+ font-size: 1rem;
356
+ }
357
+ }
358
+ .list {
359
+ line-height: 1px;
360
+ }
361
+ .strategy-title {
362
+ margin-bottom: 1vw;
363
+ }
364
+ .circle {
365
+ position: relative;
366
+ display: inline-block;
367
+ width: 80px;
368
+ height: 80px;
369
+ border-radius: 50%;
370
+ background: skyblue;
371
+ }
372
+
373
+ .circle span {
374
+ position: absolute;
375
+ display: inline-block;
376
+ left: 0;
377
+ top: 50%;
378
+ -webkit-transform: translateY(-50%);
379
+ transform: translateY(-50%);
380
+ width :80px;
381
+ text-align:center;
382
+ }
383
+ ```

1

画像添付

2020/10/17 15:54

投稿

Larkiwing
Larkiwing

スコア120

title CHANGED
File without changes
body CHANGED
@@ -1,4 +1,4 @@
1
- footerの部分を作っているのですが、なぜか画面幅が合いません。
1
+ ![イメージ説明](6fd8c0b699d5d8173b6e4736b02208e2.png)footerの部分を作っているのですが、なぜか画面幅が合いません。
2
2
  ちょっとだけ右にずれてしまっているのですが、何がいけないのかわかる方回答をお願いします。
3
3
 
4
4
  ```html