質問編集履歴

1

コード追加

2021/10/17 08:28

投稿

music
music

スコア13

test CHANGED
File without changes
test CHANGED
@@ -17,3 +17,171 @@
17
17
  デバイスごとのwidthに合わせて、
18
18
 
19
19
  中心だけ固定で両サイドを表示・非表示させる方法をご存じの方いらっしゃいますか?
20
+
21
+
22
+
23
+ 下記top-imageの背景に適用させたいです。
24
+
25
+
26
+
27
+ ```html
28
+
29
+ <header>
30
+
31
+ <div class="mobile">
32
+
33
+ <div class="nav">
34
+
35
+ <div class="hum">
36
+
37
+ <div class="title">
38
+
39
+ <p>寿司創作 dining 魚魚(とと)</p>
40
+
41
+ </div>
42
+
43
+ <img src="mobile-images/hum-menu.jpg" alt="">
44
+
45
+ </div>
46
+
47
+ </div>
48
+
49
+ <div class="top-image">
50
+
51
+
52
+
53
+ <div class="top-logo">
54
+
55
+ <img class="mobile-logo" src="mobile-images/mobile-logo.png" alt="">
56
+
57
+ </div>
58
+
59
+ </div>
60
+
61
+ </div>
62
+
63
+ </header>
64
+
65
+ ```
66
+
67
+
68
+
69
+ ```scss
70
+
71
+ header{
72
+
73
+ background-image: url(../mobile-images/mobile-top-back.jpg);
74
+
75
+ background-size: 346px 443px;
76
+
77
+ background-repeat: repeat-x;
78
+
79
+
80
+
81
+
82
+
83
+ .nav{
84
+
85
+ width: 100%;
86
+
87
+ height: 65px;
88
+
89
+ position: absolute;
90
+
91
+ z-index: 2;
92
+
93
+ top: 0;
94
+
95
+ background-image: url(../mobile-images/mobile-header.jpg);
96
+
97
+ box-shadow: 0px 3px 6px rgba($color: #4A3A2A, $alpha: 1);
98
+
99
+
100
+
101
+ .hum{
102
+
103
+ display: flex;
104
+
105
+ justify-content: space-between;
106
+
107
+ align-items: center;
108
+
109
+ line-height: 100%;
110
+
111
+
112
+
113
+
114
+
115
+ .title{
116
+
117
+ @include font(20px);
118
+
119
+ margin: 0 auto;
120
+
121
+ }
122
+
123
+
124
+
125
+ img{
126
+
127
+ width: 65px;
128
+
129
+ }
130
+
131
+ }
132
+
133
+ }
134
+
135
+
136
+
137
+ .top-image{
138
+
139
+ margin: 0 auto;
140
+
141
+ width: 375px;
142
+
143
+ height: 443px;
144
+
145
+ background-image: url(../mobile-images/mobile-interior-top.jpg);
146
+
147
+ background-repeat: no-repeat;
148
+
149
+ background-size: 376px;
150
+
151
+ position: relative;
152
+
153
+ z-index: 1;
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+ .top-logo{
162
+
163
+ position: absolute;
164
+
165
+ top: 143px;
166
+
167
+ left: 56px;
168
+
169
+ //width: 376px;
170
+
171
+
172
+
173
+ .mobile-logo{
174
+
175
+ width: 263px;
176
+
177
+ margin: auto;
178
+
179
+ }
180
+
181
+ }
182
+
183
+ }
184
+
185
+ }
186
+
187
+ ```