<main class="container">
<div class="button-grid">
<div class="top-rows">
<div class="button-body button-blue">
<button class="button-cap blue-cap-blue">C</button>
</div>
<div class="button-body button-blue">
<button class="button-cap blue-cap-blue">CE</button>
</div>
<div class="button-body button-blue">
<button class="button-cap blue-cap-blue">%</button>
</div>
<div class="button-body button-blue">
<button class="button-cap blue-cap-blue">÷</button>
</div>
<div class="button-body">
<button class="button-cap">7</button>
</div>
<div class="button-body">
<button class="button-cap">8</button>
</div>
<div class="button-body">
<button class="button-cap">9</button>
</div>
<div class="button-body button-blue">
<button class="button-cap blue-cap-blue">x</button>
</div>
<div class="button-body">
<button class="button-cap">4</button>
</div>
<div class="button-body">
<button class="button-cap">5</button>
</div>
<div class="button-body">
<button class="button-cap">6</button>
</div>
<div class="button-body button-blue">
<button class="button-cap blue-cap-blue">-</button>
</div>
<div class="button-body">
<button class="button-cap">1</button>
</div>
<div class="button-body">
<button class="button-cap">2</button>
</div>
<div class="button-body">
<button class="button-cap">3</button>
</div>
<div class="button-body button-blue">
<button class="button-cap blue-cap-blue">+</button>
</div>
</div>
<div class="bottom-row">
<div class="button-body wider-button">
<button class="button-cap wider-cap">0</button>
</div>
<div class="button-body">
<button class="button-cap">.</button>
</div>
<div class="button-body wider-button">
<button class="button-cap wider-cap">=</button>
</div>
</div>
</main>
@import url(https://fonts.googleapis.com/css?family=Audiowide);
* {
box-sizing: border-box;
}
body {
padding: 0;
margin: 0;
}
// I'm using this to center the button to the screen
.container {
/* layout */
display: flex;
width: 100vw;
height: 100vh;
justify-content: center;
align-items: center;
/* style */
background: #2b3d25;
}
.button-grid {
display: grid;
}
.top-rows {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 3px;
}
.button-body {
/* layout */
display: flex;
justify-content: center;
width: 75px;
height: 75px;
padding-top: 2px;
/* style */
background: linear-gradient(145deg, rgb(120, 118, 99), #fff9d6);
border-radius: 3px;
box-shadow: 0 0 0 1px rgba(16, 22, 26, 0.1), 0 0px 2px rgba(16, 22, 26, 0.2),
0 0px 1px rgba(16, 22, 26, 0.2);
/* effects */
&:active {
transform: scale(0.95); /* Add this line */
background: linear-gradient(145deg, rgb(120, 118, 99), #fff9d6);
box-shadow: 0 0 0 1px rgba(16, 22, 26, 0.1), 0 0px 2px rgba(16, 22, 26, 0.2),
0 0px 1px rgba(16, 22, 26, 0.2);
}
}
.button-cap {
/* layout */
width: 65px;
height: 65px;
border-radius: 5px;
/* style */
border: none;
background: linear-gradient(145deg, #d6d2b4, #fff9d6);
box-shadow: 0 0 0 1px rgba(16, 22, 26, 0.1), 0 0px 2px rgba(16, 22, 26, 0.2),
0 0px 1px rgba(16, 22, 26, 0.2);
/* typography */
font-family: "Audiowide", cursive;
color: black;
font-size: larger;
/* effects */
&:active {
transform: scale(0.95); /* Add this line */
background: linear-gradient(145deg, #d6d2b4, #fff9d6);
box-shadow: 0 0 0 1px rgba(16, 22, 26, 0.1), 0 0px 2px rgba(16, 22, 26, 0.2),
0 0px 1px rgba(16, 22, 26, 0.2);
}
&:hover {
cursor: pointer;
}
}
.button-blue {
background: linear-gradient(145deg, rgb(110, 131, 129), #d6fff9);
/* effects */
&:active {
transform: scale(0.95); /* Add this line */
background: linear-gradient(145deg, rgb(110, 131, 129), #d6fff9);
box-shadow: 0 0 0 1px rgba(16, 22, 26, 0.1), 0 0px 2px rgba(16, 22, 26, 0.2),
0 0px 1px rgba(16, 22, 26, 0.2);
}
}
.blue-cap-blue {
background: linear-gradient(145deg, #b4d6d2, #d6fff9);
&:active {
transform: scale(0.95); /* Add this line */
background: linear-gradient(145deg, #b4d6d2, #d6fff9);
box-shadow: 0 0 0 1px rgba(16, 22, 26, 0.1), 0 0px 2px rgba(16, 22, 26, 0.2),
0 0px 1px rgba(16, 22, 26, 0.2);
}
}
.bottom-row {
display: flex;
justify-content: space-between;
gap: 5px;
padding-top: 3px;
}
.wider-button {
width: 35%;
}
.wider-cap {
width: 90%;
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.