周末在家无事,就想写一个计算器来玩,然后去百度看了好多大牛写的代码感觉很复杂,以我现在的程度还是难以理解,所以我自己写了一个特别简单的计算器。直接上代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>计算器</title>
<style type="text/css">
p{
text-align: center;
font-size: 16px;
}
.box{
margin: 0 auto;
width: 215px;
height: 245px;
border: 1px solid red;
}
.sty{
width: 50px;
height: 30px;
margin-top: 6px;
border-radius: 17px;
cursor: pointer;
}
.sty:hover{
background-color: aquamarine;
}
#field{
line-height: 50px;
font-size: 39px;
width: 212px;
height: 51px;
border-bottom: 1px solid #FF0000;
margin-bottom: -20px;
overflow: hidden;
}
</style>
</head>
<body>
<div class="box">
<div type="text" id="field" /></div> <br />
<input class = "sty" type="button" onclick="num(7)" value="7"/>
<input class = "sty" ty

最低0.47元/天 解锁文章
482

被折叠的 条评论
为什么被折叠?



