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

質問編集履歴

2

記入変更

2020/02/18 01:27

投稿

katusi
katusi

スコア12

title CHANGED
@@ -1,1 +1,1 @@
1
- スマホのレスポンシブ化で余白が出来るのですが、、
1
+ スマホのレスポンシブ化で余白が出来るのですが、、no.1
body CHANGED
@@ -1,7 +1,320 @@
1
- ```URL
2
- [既存サイトを模写したもの]
3
- *コードを貼ると1000文字に収まらなかったのでリンクを貼りました。*
1
+ ```HTML
2
+ <!DOCTYPE html>
3
+ <html lang="ja">
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <meta name="viewport" content="width=device-width,user-scalable=yes,maximum-scale=2">
7
+ <link rel="stylesheet" type="text/css" href="practice11.css">
8
+
9
+ <link href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" rel="stylesheet">
10
+ <title>practice11</title>
11
+ </head>
12
+
13
+ <body>
14
+ <header>
15
+ <div class="inner">
16
+ <div class="header-logo"><a href="https://xeory.jp/extension">XeoryExtension</a></div>
17
+ <div class="menu">
18
+ <div class="menu1"><a href="https://xeory.jp/extension/sample">記事ページサンプル</a></div>
19
+ <div class="menu2"><a href="https://xeory.jp/template/xeory-extension/">Extensionをダウンロード</a></div>
20
+ </div>
21
+ <div id="page_top"><a href="#"></a></div>
22
+ </div>
23
+ </header>
24
+
25
+ <div id="section1">
26
+ <div class="inner">
27
+ <h1>Xeory Extension</h1>
28
+ <p>Xeory Extensionはワンコラムのサイト型テーマです。ユーザーに対して重要なコンテン<br>ツを効率的に届けられるようにデザインされています。5種類のカラーバリエーションを
29
+ <br>用意しています。
30
+ </p>
31
+ </div>
32
+ </div>
33
+
34
+ <div id="section2">
35
+ <div class="inner">
36
+ <h2 class="section2-ttl"><i class="fas fa-flag"></i>人気のある記事</h2>
37
+ <div class="flex-box">
38
+ <ul>
39
+ <li><a href="https://xeory.jp/extension/demo-top"><img src="https://xeory.jp/extension/wp-content/uploads/sites/4/2014/10/MacBook-and-clutter.png" alt=""><p class="num1">NO.1</p>
40
+ <p class="background-green">カテゴリー#1</p>
41
+ <p class="test">テスト投稿</p></a>
42
+ </li>
43
+ <li><a href="https://xeory.jp/extension/extension-cta"><img src="https://xeory.jp/extension/wp-content/uploads/sites/4/2014/10/macbook-holding.png" alt=""><p class="num2">NO.2</p>
44
+ <p class="background-green">カテゴリー#1</p>
45
+ <p class="test">テスト投稿</p></a>
46
+ </li>
47
+ <li><a href="https://xeory.jp/extension/facebook-likebox"><img src="https://xeory.jp/extension/wp-content/uploads/sites/4/2014/10/communication.png" alt=""><p class="num3">NO.3</p>
48
+ <p class="background-green">カテゴリー#1</p>
49
+ <p class="test">テスト投稿</p></a>
50
+ </li>
51
+ <li><a href="https://xeory.jp/extension/wp-gallery"><img src="https://xeory.jp/extension/wp-content/uploads/sites/4/2014/10/macbook-at-the-coffee-shop.jpg" alt=""><p class="num4">NO.4</p>
52
+ <p class="background-green">カテゴリー#1</p>
53
+ <p class="test">テスト投稿</p></a>
54
+ </li>
55
+ <li><a href="https://xeory.jp/extension/xeorybase-social-media"><img src="https://xeory.jp/extension/wp-content/uploads/sites/4/2014/10/rest-time-in-front-of-macbook.png" alt=""><p class="num5">NO.5</p>
56
+ <p class="background-green">カテゴリー#1</p>
57
+ <p class="test">テスト投稿</p></a>
58
+ </li>
59
+ </ul>
60
+ </div><!--flex-box-->
61
+ </div>
62
+ </div><!--section2-->
63
+
64
+ <div id="section3">
65
+ <div class="inner">
66
+ <h2 class="section3-ttl"><i class="far fa-clock"></i>最近の投稿</h2>
67
+ <div class="flex-box">
68
+ <ul>
69
+ <li><a href="https://xeory.jp/extension/demo-top"><img src="https://xeory.jp/extension/wp-content/uploads/sites/4/2014/10/MacBook-and-clutter.png" alt=""><p class="date">2014<br>10/24</p>
70
+ <p class="background-green">カテゴリー#1</p>
71
+ <p class="test">テスト投稿</p></a>
72
+ </li>
73
+ <li><a href="https://xeory.jp/extension/extension-cta"><img src="https://xeory.jp/extension/wp-content/uploads/sites/4/2014/10/macbook-holding.png" alt=""><p class="date">2014<br>10/24</p>
74
+ <p class="background-green">カテゴリー#1</p>
75
+ <p class="test">テスト投稿</p></a>
76
+ </li>
77
+ <li><a href="https://xeory.jp/extension/facebook-likebox"><img src="https://xeory.jp/extension/wp-content/uploads/sites/4/2014/10/communication.png" alt=""><p class="date">2014<br>10/24</p>
78
+ <p class="background-green">カテゴリー#1</p>
79
+ <p class="test">テスト投稿</p></a>
80
+ </li>
81
+ <li><a href="https://xeory.jp/extension/wp-gallery"><img src="https://xeory.jp/extension/wp-content/uploads/sites/4/2014/10/macbook-at-the-coffee-shop.jpg" alt=""><p class="date">2014<br>10/24</p>
82
+ <p class="background-green">カテゴリー#1</p>
83
+ <p class="test">テスト投稿</p></a>
84
+ </li>
85
+ <li><a href="https://xeory.jp/extension/xeorybase-social-media"><img src="https://xeory.jp/extension/wp-content/uploads/sites/4/2014/10/rest-time-in-front-of-macbook.png" alt=""><p class="date">2014<br>10/24</p>
86
+ <p class="background-green">カテゴリー#1</p>
87
+ <p class="test">テスト投稿</p></a>
88
+ </li>
89
+ </ul>
90
+ </div><!--flex-box-->
91
+ </div>
92
+ </div><!--section3-->
93
+
94
+
95
+
96
+
97
+ </body>
98
+
99
+ </html>
100
+
4
101
  ```
102
+ ```css
103
+ .inner {
104
+ overflow: hidden;
105
+ max-width: 100%;
106
+ }
107
+ body {
108
+ margin: 0;
109
+ padding: 0;
110
+ max-width: 100%;
111
+ border: 1px solid red;
112
+ }
113
+ body a {
114
+ text-decoration: none;
115
+ }
116
+ body ul {
117
+ list-style: none;
118
+ }
119
+
120
+ header {
121
+ background-color:rgb(70,179,157,0.9);
122
+ position: relative;
123
+ height: 80px;
124
+ max-width: 100%;
125
+ margin: 0;
126
+ }
127
+ header a {
128
+ color: white;
129
+ }
130
+ /*PAGE TOPボタン追加*/
131
+ #page_top{
132
+ width: 50px;
133
+ height: 50px;
134
+ position: fixed;
135
+ right: 0;
136
+ bottom: 50px;
137
+ background: #003a75; /*ボタンの色*/
138
+ opacity: 0.6;
139
+ border-radius: 50%; /*角の丸み*/
140
+ z-index: 1005;
141
+ }
142
+ #page_top a{
143
+ position: absolute;
144
+ display: block;
145
+ width: 50px;
146
+ height: 50px;
147
+ text-decoration: none;
148
+ }
149
+ #page_top a::before{
150
+ font-family: "Font Awesome 5 Free";
151
+ content: "\f102"; /*アイコン*/
152
+ font-weight: 900;
153
+ font-size: 25px;
154
+ color: #fff; /*アイコンの色*/
155
+ position: absolute;
156
+ width: 25px;
157
+ height: 25px;
158
+ top: 0;
159
+ bottom: 0;
160
+ right: 0;
161
+ left: 0;
162
+ margin: auto;
163
+ text-align: center;
164
+ }
165
+
166
+ .header-logo {
167
+ position: absolute;
168
+ font-size: 20px;
169
+ letter-spacing: 1px;
170
+ padding: 20px 60px;
171
+ margin: ;
172
+ }
173
+ .header-logo a {
174
+ font-weight: 100;
175
+ }
176
+ .menu {
177
+ display: table;
178
+ position: absolute;
179
+ right: 2rem;
180
+ font-size: 16px;
181
+ }
182
+ .menu1, .menu2 {
183
+ display: table-cell;
184
+ padding: 30px 30px;
185
+ margin: 10px;
186
+ }
187
+ .menu a {
188
+ display: block;
189
+ }
190
+ .menu1:hover, .menu2:hover {
191
+ background-color: #46B39D;
192
+ opacity: 0.7;
193
+ }
194
+ #section1 {
195
+ background-color: #41B29D;
196
+ height: 800px;
197
+ position: relative;
198
+ max-width: 100%;
199
+ margin: 0;
200
+ }
201
+ #section1 .inner {
202
+ color: white;
203
+ position: relative;
204
+ text-align: center;
205
+ }
206
+ #section1 h1 {
207
+ font-weight: 200;
208
+ font-size: 45px;
209
+ margin-top: 250px;
210
+ }
211
+ #section2 {
212
+ position: relative;
213
+ height: 490px;
214
+ border-bottom: 1px solid #E5E5E5;
215
+ background-color: #FBFBFB;
216
+ max-width: 100%;
217
+ margin: 0;
218
+ }
219
+ .section2-ttl i {
220
+ font-size: 20px;
221
+ margin: 10px;
222
+ }
223
+ .section2-ttl, .section3-ttl {
224
+ font-weight: 400;
225
+ text-align: center;
226
+ border-top: 1px solid #E5E5E5;
227
+ border-bottom: 1px solid #E5E5E5;
228
+ margin-top: 60px;
229
+ padding-top: 20px;
230
+ padding-bottom: 20px;
231
+ background-color: white;
232
+ max-width: 100%;
233
+ margin: 0;
234
+ }
235
+ .flex-box {
236
+ display: flex;
237
+ justify-content: center;
238
+ background-color: white;
239
+ max-width: 100%;
240
+ position: relative;
241
+ }
242
+ .flex-box ul {
243
+ display: flex;
244
+ max-width: 100%;
245
+ margin: 50px;
246
+ position: relative;
247
+ }
248
+ .flex-box li {
249
+ margin: 10px;
250
+ margin-top: 0;
251
+ padding: 0;
252
+ max-width: 100%;
253
+ }
254
+ .flex-box img {
255
+ width: 95%;
256
+ height: 60%;
257
+
258
+ }
259
+ .num1, .num2, .num3, .num4, .num5, .date {
260
+ color: white;
261
+ font-weight: 200;
262
+ font-size: 14px;
263
+ width: 40px;
264
+ position: absolute;
265
+ padding: 10px 4px 10px 6px;
266
+ max-width: 100%;
267
+ top: 0;
268
+ margin-top: 0;
269
+ }
270
+ .num1 {
271
+ background-color: #E3C779;
272
+ opacity: 0.9;
273
+ }
274
+ .num2 {
275
+ background-color: #A4ACB0;
276
+ opacity: 0.8;
277
+ }
278
+ .num3 {
279
+ background-color: #844E37;
280
+ opacity: 0.8;
281
+ }
282
+ .num4 {
283
+ background-color: #5C432A;
284
+ opacity: 0.8;
285
+ }
286
+ .num5 {
287
+ background-color: #5E5F4E;
288
+ opacity: 0.8;
289
+ }
290
+ .background-green {
291
+ background-color: #46B39D;
292
+ color: white;
293
+ font-size: 14px;
294
+ padding: 5px 10px;
295
+ width: 100px;
296
+ }
297
+ .test {
298
+ color: black;
299
+ margin: 0;
300
+ }
301
+ .test:hover {
302
+ border-bottom: 1px solid #46B39D;
303
+ width: 80px;
304
+ margin: 0;
305
+ }
306
+ #section3 {
307
+ position: relative;
308
+ margin-top: 0;
309
+ border-bottom: 1px solid #E5E5E5;
310
+ height: 480px;
311
+ }
312
+ .section3-ttl {
313
+ margin-top: 40px;
314
+ }
315
+
316
+
317
+ ```
5
318
  ### 前提・実現したいこと
6
319
  今現在スマホ用にレスポンシブ対応を行なっているのですが、画面のサイズをpc用から少しでも小さくすると右側に余白ができてしまいます。
7
320
  google検証でスマホ用の画面で見ても大きく右に余白が出来てしまいます。

1

記入ミス

2020/02/18 01:27

投稿

katusi
katusi

スコア12

title CHANGED
File without changes
body CHANGED
@@ -1,5 +1,5 @@
1
1
  ```URL
2
- [既存サイトを模写したもの](file:///Users/shanyuanyizhi/Downloads/practice11.html#)
2
+ [既存サイトを模写したもの]
3
3
  *コードを貼ると1000文字に収まらなかったのでリンクを貼りました。*
4
4
  ```
5
5
  ### 前提・実現したいこと