回答編集履歴

3

コード追記

2020/09/23 02:14

投稿

hatena19
hatena19

スコア33795

test CHANGED
@@ -19,3 +19,73 @@
19
19
  }
20
20
 
21
21
  ```
22
+
23
+
24
+
25
+ ---
26
+
27
+ [https://popo-design.net/template](https://popo-design.net/template)/
28
+
29
+ の最初のテンプレートを使っているのですね。
30
+
31
+ テンプレートをダウンロードしてみました。
32
+
33
+ bootstrap的なCSSフレームワークな造りになっているので、既存のクラスを修正するのは他の部分に影響を及ぼしますので、修正したい要素にクラスを追加して、そのクラスにCSSを設定するようにした方がいいでしょう。
34
+
35
+
36
+
37
+ ```HTML
38
+
39
+ <div class="row flow">
40
+
41
+ <div class="col span-3 flex-col">
42
+
43
+ <img src="https://placehold.jp/150x150.png">
44
+
45
+ </div>
46
+
47
+ <div class="col span-9 flex-col">
48
+
49
+ <h3>ここに題名が入ります。ここに題名が入ります。</h3>
50
+
51
+ <p>ここに文章が入ります。ここに文章が入ります。ここに文章が入ります。</p>
52
+
53
+ </div>
54
+
55
+ </div>
56
+
57
+ ```
58
+
59
+ 画像の親要素と、題名、文章の親要素に、flex-col というクラスを追加します。
60
+
61
+
62
+
63
+ ```css
64
+
65
+ .flex-col {
66
+
67
+ display: flex;
68
+
69
+ flex-direction: column;
70
+
71
+ justify-content: center;
72
+
73
+ align-items: center;
74
+
75
+ }
76
+
77
+
78
+
79
+ /* 以下はお好みで */
80
+
81
+ .flex-col > img {
82
+
83
+ width: 100%; /* 画像の幅を親要素に揃える */
84
+
85
+ }
86
+
87
+ ```
88
+
89
+
90
+
91
+ 以上でどうでしょう。

2

コード削除

2020/09/23 02:14

投稿

hatena19
hatena19

スコア33795

test CHANGED
@@ -19,75 +19,3 @@
19
19
  }
20
20
 
21
21
  ```
22
-
23
-
24
-
25
- ---
26
-
27
- 現状のCSSの提示がないので、画像とクラス名から適当に想像したコード例です。
28
-
29
- ご参考までに。
30
-
31
-
32
-
33
- ```css
34
-
35
- .center {
36
-
37
- text-align: center;
38
-
39
- }
40
-
41
-
42
-
43
- .row {
44
-
45
- display: flex;
46
-
47
- flex-wrap: wrap;
48
-
49
- justify-content: center;
50
-
51
- margin-bottom: 10px;
52
-
53
- }
54
-
55
- .span-3 {
56
-
57
- width: 25%;
58
-
59
- min-width: 200px;
60
-
61
- display: flex;
62
-
63
- justify-content: center;
64
-
65
- align-items: center;
66
-
67
- }
68
-
69
-
70
-
71
- .span-3 img {
72
-
73
- width: 100%;
74
-
75
- }
76
-
77
-
78
-
79
- .span-9 {
80
-
81
- width: 75%;
82
-
83
- display: flex;
84
-
85
- flex-direction: column;
86
-
87
- justify-content: center;
88
-
89
- align-items: center;
90
-
91
- }
92
-
93
- ```

1

コード追記

2020/09/22 13:26

投稿

hatena19
hatena19

スコア33795

test CHANGED
@@ -19,3 +19,75 @@
19
19
  }
20
20
 
21
21
  ```
22
+
23
+
24
+
25
+ ---
26
+
27
+ 現状のCSSの提示がないので、画像とクラス名から適当に想像したコード例です。
28
+
29
+ ご参考までに。
30
+
31
+
32
+
33
+ ```css
34
+
35
+ .center {
36
+
37
+ text-align: center;
38
+
39
+ }
40
+
41
+
42
+
43
+ .row {
44
+
45
+ display: flex;
46
+
47
+ flex-wrap: wrap;
48
+
49
+ justify-content: center;
50
+
51
+ margin-bottom: 10px;
52
+
53
+ }
54
+
55
+ .span-3 {
56
+
57
+ width: 25%;
58
+
59
+ min-width: 200px;
60
+
61
+ display: flex;
62
+
63
+ justify-content: center;
64
+
65
+ align-items: center;
66
+
67
+ }
68
+
69
+
70
+
71
+ .span-3 img {
72
+
73
+ width: 100%;
74
+
75
+ }
76
+
77
+
78
+
79
+ .span-9 {
80
+
81
+ width: 75%;
82
+
83
+ display: flex;
84
+
85
+ flex-direction: column;
86
+
87
+ justify-content: center;
88
+
89
+ align-items: center;
90
+
91
+ }
92
+
93
+ ```