源码Demo:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>js计算器</title>
</head>
<style>
*{
border: none;
margin: 0 auto;
padding: 0;
font-family: 'Open Sans', sans-serif;
}
.center{ /*居中*/
margin: 0 auto;
text-align: center;
}
h1{
color: #495678;
font-size: 30px;
display: block;
margin: 25px;
}
form{
background-color: #495678;
box-shadow: 4px 4px #3d4a65;
width: 350px;
height: 380px;
border-radius: 18px;
padding-top: 45px;
}
.btn{
cursor: pointer;
font-size: 20px;
width: 45px;
height: 45px;
margin: 10px;
border-radius: 15px;
outline: none;/*避免点击按钮时出现轮廓*/
}
.number{
background-color: #72778b;
box-shadow: 0 4px #5f6680;
color: white;
}
.operator{
background-color: #dededc;
box-shadow: 0 4px #bebebe;
color: #72778b;
}
.other{
background-co