質問するログイン新規登録

質問編集履歴

3

クリア(C)がされないつかしました

2020/08/19 01:08

投稿

ARAZIN
ARAZIN

スコア15

title CHANGED
File without changes
body CHANGED
@@ -5,8 +5,8 @@
5
5
  ### 発生している問題・エラーメッセージ
6
6
  動画では数字を入力するところが大きいのに小さい
7
7
  テンキーみたいになるはずがなぜか2列
8
+ クリア(C)がされない
8
9
 
9
-
10
10
  ```HTML
11
11
  <!DOCTYPE html>
12
12
  <html lang="ja">

2

クリア(C)がされないを追加しました

2020/08/19 01:07

投稿

ARAZIN
ARAZIN

スコア15

title CHANGED
File without changes
body CHANGED
File without changes

1

コードを追加しました

2020/08/19 01:06

投稿

ARAZIN
ARAZIN

スコア15

title CHANGED
@@ -1,1 +1,1 @@
1
- HTML(VSC)で動画を見て作ったがわからなくたってしまった!
1
+ HTML(Visual Studio Code)で動画を見て作ったがわからなくたってしまった!
body CHANGED
@@ -1,5 +1,5 @@
1
1
  ### 前提・実現したいこと
2
- VSC(HTML)で動画を見ながら電卓を作っていたがどこが間違っているかわからなったので教えてほしい。
2
+ Visual Studio Code(HTML)で動画を見ながら電卓を作っていたがどこが間違っているかわからなったので教えてほしい。
3
3
  丸投げなんですが申し訳ないです。
4
4
 
5
5
  ### 発生している問題・エラーメッセージ
@@ -7,7 +7,103 @@
7
7
  テンキーみたいになるはずがなぜか2列
8
8
 
9
9
 
10
+ ```HTML
11
+ <!DOCTYPE html>
12
+ <html lang="ja">
13
+ <head>
14
+ <meta charset="UTF-8">
15
+ <link rel="stylesheet" type="text/css" href="sttyle.css">
16
+ <title>denntaku</title>
17
+ </head>
18
+ <body>
19
+ <form class="calculator" name="calc">
20
+ <input class="value" type="text" name="txt" readonly="">
21
+ <span class="num clear" onclick="document.calc.txt.valyue =''">c</span>
22
+ <span class="num" onclick="document.calc.txt.value +='/'">/</span>
23
+ <span class="num" onclick="document.calc.txt.value +='*'">*</span>
24
+ <span class="num" onclick="document.calc.txt.value +='7'">7</span>
25
+ <span class="num" onclick="document.calc.txt.value +='8'">8</span>
26
+ <span class="num" onclick="document.calc.txt.value +='9'">9</span>
27
+ <span class="num" onclick="document.calc.txt.value +='-'">-</span>
28
+ <span class="num" onclick="document.calc.txt.value +='4'">4</span>
29
+ <span class="num" onclick="document.calc.txt.value +='5'">5</span>
30
+ <span class="num" onclick="document.calc.txt.value +='6'">6</span>
31
+ <span class="num plus" onclick="document.calc.txt.value +='+'">+</span>
32
+ <span class="num" onclick="document.calc.txt.value +='3'">3</span>
33
+ <span class="num" onclick="document.calc.txt.value +='2'">2</span>
34
+ <span class="num" onclick="document.calc.txt.value +='1'">1</span>
35
+ <span class="num" onclick="document.calc.txt.value +='0'">0</span>
36
+ <span class="num" onclick="document.calc.txt.value +='00'">0</span>
37
+ <span class="num" onclick="document.calc.txt.value +='.'">.</span>
38
+ <span class="num equal" onclick="document.calc.txt.value = eval(calc.txt.value)">=</span>
39
+ </form>
40
+ </body>
41
+ </html>
42
+ ```
43
+ ```CSS
44
+ @import url('https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700,800,900&display=swap');
45
+
46
+ *
47
+ {
48
+ margin: 0;
49
+ padding: 0;
50
+ box-sizing: border-box;
51
+ font-family: 'Poppins',sans-serif;
52
+ }
53
+ body
54
+ {
55
+ display: flex;
56
+ justify-content: center;
57
+ align-items: center;
58
+ min-height: 100vh;
59
+ background: #091921;
60
+ }
61
+ .calculator
62
+ {
63
+ position: relative;
64
+ display: grid;
65
+ }
66
+ .calculator.value
67
+ {
68
+ grid-column:span 4;
69
+ height: 100px;
70
+ text-align: right;
71
+ border: none;
72
+ outline: none;
73
+ padding: 10px;
74
+ font-size: 18px;
75
+ }
76
+ .calculator span
77
+ {
78
+ display: grid;
79
+ width: 60px;
80
+ height: 60px;
81
+ color: #fff;
82
+ background: #0c2835;
83
+ place-items: center;
84
+ border: 1px solid rgba(0,0,0,.1);
85
+ }
86
+ .calculator span:active
87
+ {
88
+ background: #74FF3b;
89
+ color: #111;
90
+ }
91
+ .calculator span.clear
92
+ {
93
+ grid-column:span 2;
94
+ width: 120px;
95
+ background: #ff3077;
96
+ }
97
+ .calculator span.plus
98
+ {
99
+ grid-row:span 2;
100
+ height: 120px;
101
+ }
102
+ .calculator span.equal
103
+ {
104
+ background: #03d1ff;
105
+ }
106
+ ```
107
+
10
108
  ### 詳細
11
- > 動画のURL:https://www.youtube.com/watch?v=BuZtAqk5LIY
109
+ > 動画のURL:https://www.youtube.com/watch?v=BuZtAqk5LIY
12
-
13
- > VSCのファイル:https://21.gigafile.nu/0825-dce3455b9975f4f58c648a05c3b8ac62b