-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
97 lines (95 loc) · 2.52 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!-- <!DOCTYPE html>
<html>
<head>
<title>Calculator</title>
<style>
#calculator {
width: 300px;
height: 400px;
margin: auto;
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-template-rows: repeat(5, 1fr);
grid-gap: 10px;
padding: 10px;
border: 1px solid #ccc;
}
button {
font-size: 1.5em;
padding: 10px;
background-color: #fff;
border: 1px solid #ccc;
cursor: pointer;
}
#display {
grid-column: 1 / span 4;
font-size: 2em;
text-align: right;
padding: 10px;
background-color: #f0f0f0;
border: 1px solid #ccc;
}
</style>
</head>
<body>
<div id="calculator">
<input type="text" id="display" readonly>
<button id="clear">C</button>
<button id="backspace">CE</button>
<button id="mod">%</button>
<button id="divide">/</button>
<button id="seven">7</button>
<button id="eight">8</button>
<button id="nine">9</button>
<button id="multiply">*</button>
<button id="four">4</button>
<button id="five">5</button>
<button id="six">6</button>
<button id="subtract">-</button>
<button id="one">1</button>
<button id="two">2</button>
<button id="three">3</button>
<button id="add">+</button>
<button id="zero">0</button>
<button id="decimal">.</button>
<button id="equals">=</button>
</div>
<script src="calculator.js"></script>
</body>
</html> -->
<!DOCTYPE html>
<html>
<head>
<title>Calculator</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="calculator">
<div class="display">
<input type="text" id="result" readonly>
</div>
<div class="buttons">
<button class="operator" id="clear">C</button>
<button class="operator" id="backspace">CE</button>
<button class="operator" id="mod">%</button>
<button class="operator" id="divide">/</button>
<button id="seven">7</button>
<button id="eight">8</button>
<button id="nine">9</button>
<button class="operator" id="multiply">*</button>
<button id="four">4</button>
<button id="five">5</button>
<button id="six">6</button>
<button class="operator" id="subtract">-</button>
<button id="one">1</button>
<button id="two">2</button>
<button id="three">3</button>
<button class="operator" id="add">+</button>
<button id="zero">0</button>
<button id="decimal">.</button>
<button class="operator" id="equals">=</button>
</div>
</div>
<script type="text/javascript" src="script.js"></script>
</body>
</html>