質問編集履歴
3
クリア(C)がされないつかしました
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
テンキーみたいになるはずがなぜか2列
|
14
14
|
|
15
|
-
|
15
|
+
クリア(C)がされない
|
16
16
|
|
17
17
|
|
18
18
|
|
2
クリア(C)がされないを追加しました
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
1
コードを追加しました
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
HTML(VSC)で動画を見て作ったがわからなくたってしまった!
|
1
|
+
HTML(Visual Studio Code)で動画を見て作ったがわからなくたってしまった!
|
test
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
### 前提・実現したいこと
|
2
2
|
|
3
|
-
VSC(HTML)で動画を見ながら電卓を作っていたがどこが間違っているかわからなったので教えてほしい。
|
3
|
+
Visual Studio Code(HTML)で動画を見ながら電卓を作っていたがどこが間違っているかわからなったので教えてほしい。
|
4
4
|
|
5
5
|
丸投げなんですが申し訳ないです。
|
6
6
|
|
@@ -16,10 +16,202 @@
|
|
16
16
|
|
17
17
|
|
18
18
|
|
19
|
+
```HTML
|
20
|
+
|
21
|
+
<!DOCTYPE html>
|
22
|
+
|
23
|
+
<html lang="ja">
|
24
|
+
|
25
|
+
<head>
|
26
|
+
|
27
|
+
<meta charset="UTF-8">
|
28
|
+
|
29
|
+
<link rel="stylesheet" type="text/css" href="sttyle.css">
|
30
|
+
|
31
|
+
<title>denntaku</title>
|
32
|
+
|
33
|
+
</head>
|
34
|
+
|
35
|
+
<body>
|
36
|
+
|
37
|
+
<form class="calculator" name="calc">
|
38
|
+
|
39
|
+
<input class="value" type="text" name="txt" readonly="">
|
40
|
+
|
41
|
+
<span class="num clear" onclick="document.calc.txt.valyue =''">c</span>
|
42
|
+
|
43
|
+
<span class="num" onclick="document.calc.txt.value +='/'">/</span>
|
44
|
+
|
45
|
+
<span class="num" onclick="document.calc.txt.value +='*'">*</span>
|
46
|
+
|
47
|
+
<span class="num" onclick="document.calc.txt.value +='7'">7</span>
|
48
|
+
|
49
|
+
<span class="num" onclick="document.calc.txt.value +='8'">8</span>
|
50
|
+
|
51
|
+
<span class="num" onclick="document.calc.txt.value +='9'">9</span>
|
52
|
+
|
53
|
+
<span class="num" onclick="document.calc.txt.value +='-'">-</span>
|
54
|
+
|
55
|
+
<span class="num" onclick="document.calc.txt.value +='4'">4</span>
|
56
|
+
|
57
|
+
<span class="num" onclick="document.calc.txt.value +='5'">5</span>
|
58
|
+
|
59
|
+
<span class="num" onclick="document.calc.txt.value +='6'">6</span>
|
60
|
+
|
61
|
+
<span class="num plus" onclick="document.calc.txt.value +='+'">+</span>
|
62
|
+
|
63
|
+
<span class="num" onclick="document.calc.txt.value +='3'">3</span>
|
64
|
+
|
65
|
+
<span class="num" onclick="document.calc.txt.value +='2'">2</span>
|
66
|
+
|
67
|
+
<span class="num" onclick="document.calc.txt.value +='1'">1</span>
|
68
|
+
|
69
|
+
<span class="num" onclick="document.calc.txt.value +='0'">0</span>
|
70
|
+
|
71
|
+
<span class="num" onclick="document.calc.txt.value +='00'">0</span>
|
72
|
+
|
73
|
+
<span class="num" onclick="document.calc.txt.value +='.'">.</span>
|
74
|
+
|
75
|
+
<span class="num equal" onclick="document.calc.txt.value = eval(calc.txt.value)">=</span>
|
76
|
+
|
77
|
+
</form>
|
78
|
+
|
79
|
+
</body>
|
80
|
+
|
81
|
+
</html>
|
82
|
+
|
83
|
+
```
|
84
|
+
|
85
|
+
```CSS
|
86
|
+
|
87
|
+
@import url('https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700,800,900&display=swap');
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
*
|
92
|
+
|
93
|
+
{
|
94
|
+
|
95
|
+
margin: 0;
|
96
|
+
|
97
|
+
padding: 0;
|
98
|
+
|
99
|
+
box-sizing: border-box;
|
100
|
+
|
101
|
+
font-family: 'Poppins',sans-serif;
|
102
|
+
|
103
|
+
}
|
104
|
+
|
105
|
+
body
|
106
|
+
|
107
|
+
{
|
108
|
+
|
109
|
+
display: flex;
|
110
|
+
|
111
|
+
justify-content: center;
|
112
|
+
|
113
|
+
align-items: center;
|
114
|
+
|
115
|
+
min-height: 100vh;
|
116
|
+
|
117
|
+
background: #091921;
|
118
|
+
|
119
|
+
}
|
120
|
+
|
121
|
+
.calculator
|
122
|
+
|
123
|
+
{
|
124
|
+
|
125
|
+
position: relative;
|
126
|
+
|
127
|
+
display: grid;
|
128
|
+
|
129
|
+
}
|
130
|
+
|
131
|
+
.calculator.value
|
132
|
+
|
133
|
+
{
|
134
|
+
|
135
|
+
grid-column:span 4;
|
136
|
+
|
137
|
+
height: 100px;
|
138
|
+
|
139
|
+
text-align: right;
|
140
|
+
|
141
|
+
border: none;
|
142
|
+
|
143
|
+
outline: none;
|
144
|
+
|
145
|
+
padding: 10px;
|
146
|
+
|
147
|
+
font-size: 18px;
|
148
|
+
|
149
|
+
}
|
150
|
+
|
151
|
+
.calculator span
|
152
|
+
|
153
|
+
{
|
154
|
+
|
155
|
+
display: grid;
|
156
|
+
|
157
|
+
width: 60px;
|
158
|
+
|
159
|
+
height: 60px;
|
160
|
+
|
161
|
+
color: #fff;
|
162
|
+
|
163
|
+
background: #0c2835;
|
164
|
+
|
165
|
+
place-items: center;
|
166
|
+
|
167
|
+
border: 1px solid rgba(0,0,0,.1);
|
168
|
+
|
169
|
+
}
|
170
|
+
|
171
|
+
.calculator span:active
|
172
|
+
|
173
|
+
{
|
174
|
+
|
175
|
+
background: #74FF3b;
|
176
|
+
|
177
|
+
color: #111;
|
178
|
+
|
179
|
+
}
|
180
|
+
|
181
|
+
.calculator span.clear
|
182
|
+
|
183
|
+
{
|
184
|
+
|
185
|
+
grid-column:span 2;
|
186
|
+
|
187
|
+
width: 120px;
|
188
|
+
|
189
|
+
background: #ff3077;
|
190
|
+
|
191
|
+
}
|
192
|
+
|
193
|
+
.calculator span.plus
|
194
|
+
|
195
|
+
{
|
196
|
+
|
197
|
+
grid-row:span 2;
|
198
|
+
|
199
|
+
height: 120px;
|
200
|
+
|
201
|
+
}
|
202
|
+
|
203
|
+
.calculator span.equal
|
204
|
+
|
205
|
+
{
|
206
|
+
|
207
|
+
background: #03d1ff;
|
208
|
+
|
209
|
+
}
|
210
|
+
|
211
|
+
```
|
212
|
+
|
213
|
+
|
214
|
+
|
19
215
|
### 詳細
|
20
216
|
|
21
217
|
> 動画のURL:https://www.youtube.com/watch?v=BuZtAqk5LIY
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
> VSCのファイル:https://21.gigafile.nu/0825-dce3455b9975f4f58c648a05c3b8ac62b
|