回答編集履歴

1

コードとサンプル追記

2022/06/30 01:05

投稿

hatena19
hatena19

スコア33763

test CHANGED
@@ -4,5 +4,42 @@
4
4
 
5
5
  ロゴ画像は現状のようにimg要素で、Flextレイアウトで中央配置すればいいでしょう。
6
6
 
7
+ あと、レスポンシブに関しては、PCとモバイルの差は幅ぐらいしかないので、わさわざ分けなくても、max-width で最大幅を制限するぐらいでいいでしょう。
7
8
 
9
+ ご希望のレイアウトが不明なので、一例としてのコードです。
8
10
 
11
+ ```html
12
+ <header class="header">
13
+ <div class="main-visual">
14
+ <div class="main-visual-inner">
15
+ <img src="img/sakai_coffee2.png">
16
+ </div>
17
+ </div >
18
+ </header>
19
+ ```
20
+ ```css
21
+ .header {
22
+ display: flex;
23
+ justify-content: center;
24
+ background-color:#88e2f0;
25
+ cursor: pointer;
26
+ height: 70vh;
27
+ }
28
+ .main-visual {
29
+ max-width: 1000px;
30
+ width: 1000px;
31
+ height: 100%;
32
+ text-align: center;
33
+ background-image: url("img/cafe3.jpg");
34
+ background-size: cover;
35
+ }
36
+ .main-visual-inner {
37
+ width: 100%;
38
+ height: 100%;
39
+ background: rgba(255, 255, 255, 0.4);
40
+ display: flex;
41
+ justify-content: center;
42
+ align-items: center;
43
+ }
44
+ ```
45
+ [Codepenサンプル](https://codepen.io/hatena19/pen/abYzdQv?editors=1100)