質問編集履歴

1

変更後のhtml, cssを追加、画像の追加

2022/07/29 02:20

投稿

nitori-kun
nitori-kun

スコア62

test CHANGED
File without changes
test CHANGED
@@ -8,8 +8,17 @@
8
8
 
9
9
 
10
10
  ### 該当のソースコード
11
-
11
+ 変更済み
12
+
13
+ ### 試したこと
14
+
15
+ cssは、
16
+ .clip input[type="checkbox"]:checked ~ img{
17
+ background-color: #ede327;
18
+ }
19
+ のように指定してみました。この指定方法が間違っているのか、それともinputの後にspanを用いない方がいいのかと感じています。
20
+
12
- ```20220729_clip.html
21
+ ```変更後html
13
22
  <!DOCTYPE html>
14
23
  <html lang="ja">
15
24
  <head>
@@ -62,48 +71,14 @@
62
71
  </div>
63
72
  </li>
64
73
  </ul>
65
- <div class="modal_area">
74
+
66
- <div class="modal_box">
67
- <div class="modal_bg"></div>
68
- <div class="modal_inner">
69
- <div class="modal_block">
70
- <ul>
71
- <li class="modal_btn" id="matsuda">
72
- <img src="assets/img/matsuda_cx5.png">
73
- <div class="upper_modal">
74
- <div class="modal_txt">
75
- <p>マツダ</p>
76
- <p>CX-5 CD(4WD)</p>
77
- </div>
78
- <div class="favorite">
79
- <div class="favorite_txt">
80
- <p>お気に入りに</p>
81
- <p>追加</p>
82
- </div>
83
- <div class="heart">
84
- <input type="checkbox" checked id="1" name="heart"><label for="1"></label>
85
- </div>
86
- </div>
87
- </div>
88
- <div class="detail-button">
89
- <a href="history.html"><span>詳細を見る</span><img src="assets/img/basicArrow_#cccccc.png" alt=">"/></a>
90
- </div>
91
- </li>
92
- </ul>
93
- </div>
94
- <div class="modal_close">×</div>
95
- </div>
96
- </div>
97
- </div>
98
- </div>
99
-
100
- <!--<script src="assets/js/frickty.pkgd.min.js"></script><!--flickity-->
75
+ <!--<script src="assets/js/frickty.pkgd.min.js"></script>flickity-->
101
76
 
102
77
  </body>
103
78
  </html>
104
79
  ```
105
80
 
106
- ```newCars.css
81
+ ```変更後css
107
82
  #newCars_txt h1{
108
83
  text-align: center;
109
84
  }
@@ -128,7 +103,7 @@
128
103
  box-shadow: 5px 0 13px 0px rgba(71,102,102, 0.5);
129
104
  border-radius: 5px;
130
105
  cursor: pointer;
131
- max-width: 200px;
106
+ width: 200px;/*0729 fix*/
132
107
  height: auto;
133
108
  position: relative;
134
109
  overflow: hidden;
@@ -188,6 +163,10 @@
188
163
  }
189
164
  .clip{
190
165
  display: flex;
166
+ }
167
+ .clip span{
168
+ width: 20px;
169
+ height: 20px;
191
170
  }
192
171
  .clip img{
193
172
  position: absolute;
@@ -216,7 +195,7 @@
216
195
  transform: rotate(45deg);
217
196
  transform-origin :100% 100%;
218
197
  }*/
219
- .clip input[type="checkbox"]:checked ~ img{
198
+ .clip input[type="checkbox"]:checked ~ .clip_img {
220
199
  background-color: #ede327;
221
200
  }
222
201
  /*.clip input + .clip_img:before {
@@ -322,40 +301,6 @@
322
301
  top: 0;
323
302
  font-size: 2rem;
324
303
  }
325
-
326
- @media screen and (max-width: 475px) {
327
- .js-flickity {
328
- -ms-flex-wrap: wrap;
329
- flex-wrap: wrap;
330
- -webkit-box-pack: justify;
331
- -ms-flex-pack: justify;
332
- justify-content: space-between;
333
- }
334
- .js-flickity li {
335
- width: 47.5%;
336
- margin-top: 20px;
337
- max-width: inherit;
338
- }
339
- .js-flickity li + li {
340
- margin-left: 0;
341
- }
342
- .modal_inner {
343
- width: 90%;
344
- padding: 25px;
345
- }
346
- .modal_close {
347
- top: 5px;
348
- font-size: 2.2rem;
349
- }
350
- }
351
304
  ```
352
305
 
353
- ### 試したこと
354
-
355
- cssは、
356
- .clip input[type="checkbox"]:checked ~ img{
306
+ ![変更後img](https://ddjkaamml8q8x.cloudfront.net/questions/2022-07-29/e7f7aecf-46b0-4b84-a0cc-55500fe8d359.png)
357
- background-color: #ede327;
358
- }
359
- のように指定してみました。この指定方法が間違っているのか、それともinputの後にspanを用いない方がいいのかと感じています。
360
-
361
-