css:
*{margin: 0;padding: 0} li{list-style: none} .bor{margin: 0 auto;width: 400px;height: 520px;border: 2px solid #000; margin-top: 50px;overflow: hidden;text-align: center;} .s_text{margin: 0 auto;width: 330px;height: 80px;margin-top: 15px; border: 2px solid #000000;font-size: 30px;padding-left: 20px;} .main{margin: 0 auto;width: 350px;height: 400px;margin-top: 15px;} .main ul{display: flex;height: 100%;justify-content: space-between;flex-wrap: wrap;} .main ul li{width: 80px;height: 80px;border: 1px solid #000000; text-align: center; line-height:80px;font-size: 36px;cursor: pointer ;} .main ul li:hover{background: #eeeeee;}
js:(将这段代码写在body最下面)
以上是“JavaScript如何实现简单的计算器”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注创新互联行业资讯频道!