-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcalculator.css
More file actions
48 lines (44 loc) · 1.31 KB
/
calculator.css
File metadata and controls
48 lines (44 loc) · 1.31 KB
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
/* Main container for the calculator */
.calculator {
width: 320px;
background-color: #e0e0e0;
padding: 20px;
border: 2px solid #999;
border-radius: 5px;
margin: 50px auto; /* Centers the calculator on the page */
}
/* Design for the input display screen */
#display {
width: 100%;
height: 60px;
background-color: #fff;
border: 1px solid #000;
font-size: 32px;
text-align: right; /* Aligns numbers to the right */
padding: 10px;
margin-bottom: 20px;
box-sizing: border-box; /* Ensures padding doesn't affect the width */
}
/* Grid layout for the buttons */
.buttons {
display: grid;
grid-template-columns: repeat(4, 1fr); /* Creates 4 equal columns */
gap: 10px; /* Space between buttons */
}
/* General style for all buttons */
.btn {
height: 60px;
background-color: #fff;
border: 1px solid #000;
font-size: 24px;
cursor: pointer;
display: flex;
justify-content: center; /* Centers text horizontally */
align-items: center; /* Centers text vertically */
transition: 0.2s; /* Smooth transition for hover/active effects */
}
/* Effect when a button is clicked */
.btn:active {
background-color: #ccc; /* Darkens the color on click */
transform: scale(0.95); /* Slight shrink effect for a "pressed" feel */
}