回答編集履歴
1
別案追加とサンプル追加
answer
CHANGED
@@ -5,10 +5,18 @@
|
|
5
5
|
↓これでわかりますか?
|
6
6
|
|
7
7
|
```html
|
8
|
-
<div class="bg">この要素に背景を指定する</div>
|
8
|
+
<div class="bg">1)この要素に背景を指定する</div>
|
9
9
|
```
|
10
10
|
|
11
11
|
```css
|
12
12
|
.bg{
|
13
13
|
background:url(表示したい画像のパス);
|
14
|
-
```
|
14
|
+
```
|
15
|
+
|
16
|
+
もしくは
|
17
|
+
```html
|
18
|
+
<div style="background:url(表示したい画像のパス)">2)この要素に背景を指定する</div>
|
19
|
+
```
|
20
|
+
|
21
|
+
サンプル
|
22
|
+
[https://codepen.io/recal/pen/YzrvmdJ](https://codepen.io/recal/pen/YzrvmdJ)
|