回答編集履歴

2

追記

2016/10/27 08:53

投稿

gin
gin

スコア2722

test CHANGED
@@ -79,3 +79,21 @@
79
79
  <label class="test_label" for="sample_checkbox1"><span class="test_position"><input type="checkbox" id="sample_checkbox1">文字列です</span></label>
80
80
 
81
81
  ```
82
+
83
+ ###追記その2
84
+
85
+ ```css
86
+
87
+ .test_position {
88
+
89
+ position:absolute;
90
+
91
+ top: 50%;
92
+
93
+ -webkit-transform: translateY(-50%);
94
+
95
+ transform: translateY(-50%);
96
+
97
+ }
98
+
99
+ ```

1

追記

2016/10/27 08:53

投稿

gin
gin

スコア2722

test CHANGED
@@ -43,3 +43,39 @@
43
43
  <label class="test_label test_label_bottom" for="sample_checkbox3"><input type="checkbox" id="sample_checkbox3">文字列です</label>
44
44
 
45
45
  ```
46
+
47
+ ###追記
48
+
49
+ positionでの例です。
50
+
51
+ ```css
52
+
53
+ .test_label {
54
+
55
+ position: relative;
56
+
57
+ display: block;
58
+
59
+ width: 170px;
60
+
61
+ height: 100px;
62
+
63
+ border: 1px solid #000;
64
+
65
+ }
66
+
67
+ .test_position {
68
+
69
+ position:absolute;
70
+
71
+ top: 20px;
72
+
73
+ }
74
+
75
+ ```
76
+
77
+ ```html
78
+
79
+ <label class="test_label" for="sample_checkbox1"><span class="test_position"><input type="checkbox" id="sample_checkbox1">文字列です</span></label>
80
+
81
+ ```