基础版本:
<!DOCTYPE html>
<html lang="en"><head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.board {
margin: 60px auto;
padding:20px;
background-color: #000000;
color: white;
font-size: 30px;
width: 300px;
}
input.text {
width: 100%;
height:45px;
font-size: 23pt;
padding-left: 6px;
}
.line {
display: flex;
justify-content: space-between;
padding-top: 15px;
align-items: flex-start;
}
.cell {
width:60px;
height: 60px;
line-height:60px;
text-align: center;
border-radius: 50px;
background-color: grey;
cursor: pointer;
}
.cell-operate,.equal {
background-color: orange;
}
.cell-speOperate {
background-color: darkgrey;
}
.zero {
width: 140px;
height: 60px;
}
</style>
</head>
<body>
<div class="board">
<input type="text"

这篇博客展示了如何用JavaScript和Flex布局创建一个简单的计算器。通过JavaScript为数字和运算符按钮添加点击事件,实现输入和计算功能。同时,CSS使用Flex布局为计算器设计了响应式界面。
&spm=1001.2101.3001.5002&articleId=80815018&d=1&t=3&u=dd3220c56e044dae8b4e983d2fedbe4e)
752

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



