teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

5

背景画像のCSS変更

2021/08/13 13:23

投稿

_rei_J
_rei_J

スコア4

title CHANGED
File without changes
body CHANGED
@@ -38,10 +38,20 @@
38
38
  </div>
39
39
 
40
40
  <div class="promptlyrespond">
41
+ <div class="promptlyrespond">
42
+ <style type="text/css">
43
+ .promptlyrespond {
44
+ background:center;
45
+ background-image: url("大人数シルエット.png");
46
+ background-position: top 30%;
47
+ background-repeat: no-repeat;
48
+ }
49
+ </style>
41
50
 
42
- <img src="大人数シルエット.png" width="1294" height="249" alt=""/>
51
+
43
52
  </div>
44
53
 
54
+
45
55
  <p><strong class="marker">迅速対応!</strong></p>
46
56
 
47
57
  </body>
@@ -118,12 +128,8 @@
118
128
 
119
129
  /*--迅速対応--*/
120
130
 
121
- .promptlyrespond {
122
- background-position: 100%;
123
- margin-top: 20px;
124
- position: relative;
125
- }
126
131
 
132
+
127
133
  .promptlyrespond img {
128
134
  width: 100%;
129
135
  height: auto;

4

親要素にrelative、pタグにabsolute入れた

2021/08/13 13:22

投稿

_rei_J
_rei_J

スコア4

title CHANGED
File without changes
body CHANGED
@@ -121,6 +121,7 @@
121
121
  .promptlyrespond {
122
122
  background-position: 100%;
123
123
  margin-top: 20px;
124
+ position: relative;
124
125
  }
125
126
 
126
127
  .promptlyrespond img {
@@ -130,6 +131,7 @@
130
131
 
131
132
  .promptlyrespond p{
132
133
  position: absolute;
134
+
133
135
  }
134
136
 
135
137
  .text {
@@ -142,4 +144,49 @@
142
144
  }
143
145
 
144
146
 
147
+ .icon img{
148
+ width: 100%;
149
+ }
150
+
151
+ .fadeup{
152
+ animation: fadeIn 1s ease 1s 1 normal backwards;
153
+ }
154
+ @keyframes fadeIn {/*animation-nameで設定した値を書く*/
155
+ from{
156
+ opacity: 0;/*アニメーション開始時は不透明度0%*/
157
+ transform: translateY(20px);
158
+ }
159
+ to{
160
+ opacity: 1;/*アニメーション終了時は不透明度100%*/
161
+ transform: translateY(0);
162
+ }
163
+ }
164
+
165
+
166
+ /*--迅速対応--*/
167
+
168
+ .promptlyrespond {
169
+ background-position: 100%;
170
+ margin-top: 20px;
171
+ }
172
+
173
+ .promptlyrespond img {
174
+ width: 100%;
175
+ height: auto;
176
+ }
177
+
178
+ .promptlyrespond p{
179
+ position: absolute;
180
+ }
181
+
182
+ .text {
183
+ text-align: center;
184
+ }
185
+
186
+ .marker {
187
+ font-size: 5vw;
188
+ background:linear-gradient(transparent 60%, #ffff00 0%);
189
+ }
190
+
191
+
145
192
  ```

3

テキストをdivで囲んでセンターに配置

2021/08/13 12:36

投稿

_rei_J
_rei_J

スコア4

title CHANGED
File without changes
body CHANGED
@@ -130,13 +130,16 @@
130
130
 
131
131
  .promptlyrespond p{
132
132
  position: absolute;
133
- top: 10px;
134
133
  }
134
+
135
+ .text {
136
+ text-align: center;
137
+ }
138
+
135
139
  .marker {
136
140
  font-size: 5vw;
137
141
  background:linear-gradient(transparent 60%, #ffff00 0%);
138
142
  }
139
143
 
140
144
 
141
-
142
145
  ```

2

背景画像に余白入れた

2021/08/13 12:28

投稿

_rei_J
_rei_J

スコア4

title CHANGED
File without changes
body CHANGED
@@ -120,7 +120,7 @@
120
120
 
121
121
  .promptlyrespond {
122
122
  background-position: 100%;
123
-
123
+ margin-top: 20px;
124
124
  }
125
125
 
126
126
  .promptlyrespond img {

1

下にする画像を背景画像にしてみた。

2021/08/13 12:17

投稿

_rei_J
_rei_J

スコア4

title CHANGED
File without changes
body CHANGED
@@ -118,30 +118,25 @@
118
118
 
119
119
  /*--迅速対応--*/
120
120
 
121
- .promptlyrespond{
121
+ .promptlyrespond {
122
- width: 100%;
123
- position: absolute;
122
+ background-position: 100%;
124
- display: flex;
123
+
125
- justify-content: center;
126
124
  }
127
125
 
128
126
  .promptlyrespond img {
129
127
  width: 100%;
130
128
  height: auto;
131
129
  }
132
- .resizeimsge2 img{
133
- mwidth: 100%;
134
- max-width: 100%;
135
- }
136
130
 
137
131
  .promptlyrespond p{
138
- max-width: 100%;
132
+ position: absolute;
139
- width: 100%;
133
+ top: 10px;
140
- text-align: center;
141
134
  }
142
135
  .marker {
143
136
  font-size: 5vw;
144
137
  background:linear-gradient(transparent 60%, #ffff00 0%);
145
138
  }
146
139
 
140
+
141
+
147
142
  ```