回答編集履歴

1

コメントを受けて追記

2020/12/19 07:45

投稿

Lhankor_Mhy
Lhankor_Mhy

スコア36134

test CHANGED
@@ -3,3 +3,77 @@
3
3
 
4
4
 
5
5
  `.product-single__photos img`→`img.product-single__photos`でいいのではないかな、と思うのですが、ダメですか?
6
+
7
+
8
+
9
+ # コメントを受けて追記
10
+
11
+
12
+
13
+ >__スマホ表示では80×80の正方形表示、PCでは10×10の正方形表示__
14
+
15
+
16
+
17
+ では、こんな感じでいいかと思います。
18
+
19
+
20
+
21
+ [サンプル](https://jsfiddle.net/Lhankor_Mhy/adshf9w7/)
22
+
23
+
24
+
25
+ ```scss
26
+
27
+ //theme.scss.liquid
28
+
29
+
30
+
31
+ //responsive images
32
+
33
+ .resp-img-wrapper {
34
+
35
+ width: 100%;
36
+
37
+ margin: 0 auto;
38
+
39
+
40
+
41
+ &.js {
42
+
43
+ position: relative;
44
+
45
+ }
46
+
47
+ }
48
+
49
+
50
+
51
+
52
+
53
+ //試した記述
54
+
55
+ @media (max-width:670px){// "{"忘れ
56
+
57
+ // .product-single__photos img{ クラス名の誤り
58
+
59
+ img.product-single__photo{
60
+
61
+ width: 80px;
62
+
63
+ }
64
+
65
+ } // "{"忘れ
66
+
67
+
68
+
69
+ @media (min-width:1200px){
70
+
71
+ img.product-single__photo{
72
+
73
+ width: 10px;
74
+
75
+ }
76
+
77
+ }
78
+
79
+ ```