You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* By setting box-sizing: border-box on all elements, we are ensuring that any padding or border we add to an element will be included in its total size. */
6
-
7
6
.calculator {
7
+
background-color:#f2f2f2;
8
+
padding:20px;
8
9
max-width:400px;
9
10
margin:0 auto;
10
-
margin-top:30px;
11
-
padding:20px;
12
-
background-color:#f2f2f2;
13
-
border:1px solid #ccc;
14
-
border-radius:5px;
11
+
border: solid 1px#ccc;
15
12
box-shadow:02px5pxrgba(0,0,0,0.3);
16
-
}
17
-
18
-
#result {
19
-
width:100%;
20
-
padding:10px;
21
-
font-size:24px;
22
-
border: none;
23
13
border-radius:5px;
24
-
box-shadow:02px5pxrgba(0,0,0,0.3) inset;
25
-
26
-
/* In this case, the box-shadow property is set to 0 2px 5px rgba(0, 0, 0, 0.3) inset. This means that the shadow will have no horizontal offset (0), a vertical offset of 2px, a blur radius of 5px, and a color of rgba(0, 0, 0, 0.3). The inset keyword is used to specify that the shadow should be an inset shadow, rather than an outset shadow. */
14
+
margin-top:40px;
27
15
}
28
16
29
-
.buttons {
30
-
display: grid;
31
-
grid-template-columns:repeat(4,1fr);
32
-
/* grid-template-columns: repeat(4, 1fr) is a CSS property that sets the size of each column in a grid container. In this case, the repeat(4, 1fr) value creates a grid with four equal-sized columns.
33
-
34
-
The fr unit stands for "fractional unit" and is used to divide the available space in a grid container. In this case, each column takes up an equal fraction of the available space, regardless of the size of the container.
35
-
36
-
So, with grid-template-columns: repeat(4, 1fr), the grid container will be divided into four equal-sized columns, which is what we want for our calculator layout. */
37
-
grid-gap:10px;
38
-
margin-top:20px;
17
+
#result{
18
+
width:100%;
19
+
padding:10px;
20
+
font-size:24px;
21
+
border: none;
22
+
box-shadow:02px5pxrgba(0,0,0,0.3) inset;
23
+
border-radius:5px;
39
24
}
40
25
41
-
button {
42
-
padding:10px;
43
-
font-size:24px;
44
-
border: none;
45
-
border-radius:5px;
46
-
box-shadow:02px5pxrgba(0,0,0,0.3);
47
-
cursor: pointer;
48
-
transition: background-color 0.3s ease;
26
+
.buttons{
27
+
display: grid;
28
+
grid-template-columns:repeat(4,1fr);
29
+
grid-gap:10px;
30
+
margin-top:20px;
49
31
}
50
32
51
-
button:hover {
52
-
background-color:#ddd;
53
-
}
33
+
button{
34
+
padding:10px;
35
+
font-size:24px;
36
+
border: none;
37
+
box-shadow:02px5pxrgba(0,0,0,0.3);
38
+
border-radius:5px;
39
+
cursor: pointer;
40
+
transition: background-color 0.3s ease;
54
41
55
-
.clear {
56
-
background-color:#ff4136;
57
-
color:#fff;
58
42
}
59
43
60
-
.operator {
61
-
background-color:#0074d9;
62
-
color:#fff;
44
+
button:hover{
45
+
background-color:#ddd;
63
46
}
64
47
65
-
.number{
66
-
background-color:#fff;
67
-
color:#333;
48
+
.clear{
49
+
background-color:#ff4136;
50
+
color:#fff;
68
51
}
69
52
70
-
.equals{
71
-
grid-row: span 3;
72
-
/* grid-row: span 3; is a CSS property that sets the number of rows an element spans in a CSS grid container.
53
+
.number, .decimal{
54
+
background-color:#fff;
55
+
color:#333;
73
56
74
-
In this case, span 3 is used to make the element span three rows in the grid container. */
0 commit comments