回答編集履歴
3
コード修正
test
CHANGED
@@ -7,6 +7,8 @@
|
|
7
7
|
<div class='container'>
|
8
8
|
|
9
9
|
<label>
|
10
|
+
|
11
|
+
<div class='other'>other</div>
|
10
12
|
|
11
13
|
<input />
|
12
14
|
|
@@ -26,11 +28,17 @@
|
|
26
28
|
|
27
29
|
}
|
28
30
|
|
29
|
-
.container label{
|
31
|
+
.container label {
|
32
|
+
|
33
|
+
padding: 50px;
|
30
34
|
|
31
35
|
display: block;
|
32
36
|
|
37
|
+
}
|
38
|
+
|
39
|
+
.other {
|
40
|
+
|
33
|
-
|
41
|
+
background-color: blue;
|
34
42
|
|
35
43
|
}
|
36
44
|
|
@@ -47,6 +55,8 @@
|
|
47
55
|
```html
|
48
56
|
|
49
57
|
<label class='container'>
|
58
|
+
|
59
|
+
<div class='other'>other</div>
|
50
60
|
|
51
61
|
<input />
|
52
62
|
|
@@ -68,6 +78,12 @@
|
|
68
78
|
|
69
79
|
}
|
70
80
|
|
81
|
+
.other {
|
82
|
+
|
83
|
+
background-color: blue;
|
84
|
+
|
85
|
+
}
|
86
|
+
|
71
87
|
```
|
72
88
|
|
73
89
|
|
2
説明追記
test
CHANGED
@@ -69,3 +69,11 @@
|
|
69
69
|
}
|
70
70
|
|
71
71
|
```
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
[<label> - HTML: HyperText Markup Language | MDN](https://developer.mozilla.org/ja/docs/Web/HTML/Element/label)
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
[labelタグの使い方 - HTMLリファレンス](https://code-kitchen.dev/html/label/)
|
1
コード追記
test
CHANGED
@@ -35,3 +35,37 @@
|
|
35
35
|
}
|
36
36
|
|
37
37
|
```
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
---
|
42
|
+
|
43
|
+
あるいは、div を label に変えればいいでしょう。
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
```html
|
48
|
+
|
49
|
+
<label class='container'>
|
50
|
+
|
51
|
+
<input />
|
52
|
+
|
53
|
+
</label>
|
54
|
+
|
55
|
+
```
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
```css
|
60
|
+
|
61
|
+
.container {
|
62
|
+
|
63
|
+
border: 5px solid red;
|
64
|
+
|
65
|
+
padding: 50px;
|
66
|
+
|
67
|
+
display: block;
|
68
|
+
|
69
|
+
}
|
70
|
+
|
71
|
+
```
|