回答編集履歴

1

追記

2019/01/22 02:58

投稿

akihiro3
akihiro3

スコア955

test CHANGED
@@ -93,3 +93,103 @@
93
93
 
94
94
 
95
95
  ```
96
+
97
+ 追記
98
+
99
+ ---
100
+
101
+ コメントより
102
+
103
+ 画像をテキストにとは、こういう事ですか?
104
+
105
+ ```html
106
+
107
+ <!DOCTYPE html>
108
+
109
+ <html lang="ja" dir="ltr">
110
+
111
+ <head>
112
+
113
+ <meta charset="utf-8">
114
+
115
+ <title>sample</title>
116
+
117
+ <style media="screen">
118
+
119
+ .sample1 {
120
+
121
+ width: 280px;
122
+
123
+ height: 188px;
124
+
125
+ overflow: hidden;
126
+
127
+ margin: 10px 8px 10px 16px;
128
+
129
+ position: relative; /* 相対位置指定 */
130
+
131
+ }
132
+
133
+ .sample1 .caption {
134
+
135
+ font-size: 130%;
136
+
137
+ text-align: center;
138
+
139
+ padding-top: 80px;
140
+
141
+ color: #fff;
142
+
143
+ }
144
+
145
+ .sample1 .mask {
146
+
147
+ width: 100%;
148
+
149
+ height: 100%;
150
+
151
+ position: absolute; /* 絶対位置指定 */
152
+
153
+ top: 0;
154
+
155
+ left: 0;
156
+
157
+ opacity: 0; /* マスクを表示しない */
158
+
159
+ background-color: rgba(0,0,0,0.4); /* マスクは半透明 */
160
+
161
+ -webkit-transition: all 0.2s ease;
162
+
163
+ transition: all 0.2s ease;
164
+
165
+ }
166
+
167
+ .sample1:hover .mask {
168
+
169
+ opacity: 1; /* マスクを表示する */
170
+
171
+ }
172
+
173
+ </style>
174
+
175
+ </head>
176
+
177
+ <body>
178
+
179
+ <div class="sample1">
180
+
181
+ <p>text text text text text text text text text text text text text text </p>
182
+
183
+ <div class="mask">
184
+
185
+ <div class="caption">It's fresh !</div>
186
+
187
+ </div>
188
+
189
+ </div>
190
+
191
+ </body>
192
+
193
+ </html>
194
+
195
+ ```