Calculator using HTML, CSS and Javascript
<
What is Calculator?
An electronic calculator is typically a portable electronic device used to perform calculations, ranging from basic arithmetic to complex mathematics.
VIEW DEMO
HTML CODE
CSS CODE
body {
background-color: white;
font-family: Tahoma;
}
.container {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
width: 100vw;
}
#container {
width: 200px;
padding: 8px 8px 20px 8px;
margin: 20px auto;
color: teal ;
background-color: #ABABAB;
border-radius: 4px;
border-top: 2px solid #FFF;
border-right: 2px solid #FFF;
border-bottom: 2px solid #C1C1C1;
border-left: 2px solid #C1C1C1;
box-shadow: -3px 3px 7px rgba(0, 0, 0, .6), inset -100px 0px 100px rgba(255, 255, 255, .5);
}
#display {
display: block;
margin: 15px auto;
height: 42px;
width: 174px;
padding: 0 10px;
border-radius: 4px;
border-top: 2px solid #C1C1C1;
border-right: 2px solid #C1C1C1;
border-bottom: 2px solid #FFF;
border-left: 2px solid #FFF;
background-color: #424242;
box-shadow: inset 0px 0px 10px #030303, inset 0px -20px 1px rgba(150, 150, 150, .2);
font-size: 28px;
color: white;
text-align: left;
font-weight: 400;
}
.button {
display: inline-block;
margin: 2px;
width: 42px;
height: 42px;
font-size: 16px;
font-weight: bold;
border-radius: 4px;
}
.mathButtons {
margin: 2px 2px 6px 2px;
color: #FFF;
text-shadow: -1px -1px 0px #44006F;
background-color: #434343;
border-top: 2px solid #C1C1C1;
border-right: 2px solid #C1C1C1;
border-bottom: 2px solid #181818;
border-left: 2px solid #181818;
box-shadow: 0px 0px 2px #030303, inset 0px -20px 1px #2E2E2E;
}
.digits {
color: #181818;
text-shadow: 1px 1px 0px #FFF;
background-color: #EBEBEB;
border-top: 2px solid #FFF;
border-right: 2px solid #FFF;
border-bottom: 2px solid #C1C1C1;
border-left: 2px solid #C1C1C1;
border-radius: 4px;
box-shadow: 0px 0px 2px #030303, inset 0px -20px 1px #DCDCDC;
}
.digits:hover,
.mathButtons:hover,
#clearButton:hover {
color : teal;
}
#clearButton {
color: #FFF;
text-shadow: -1px -1px 0px #44006F;
background-color: #D20000;
border-top: 2px solid #FF8484;
border-right: 2px solid #FF8484;
border-bottom: 2px solid #800000;
border-left: 2px solid #800000;
box-shadow: 0px 0px 2px #030303, inset 0px -20px 1px #B00000;
}
CodePen
Post a Comment