* {
margin: 0;
padding: 0;
box-sizing: border-box;
/* 'Poppins' 拉丁文 */
font-family: 'Poppins', sans-serif;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #091921;
}
.calculator {
position: relative;
display: grid;
}
.calculator .value {
/* grid:span是跨越的意思 */
grid-column: span 4;
height: 100px;
text-align: right;
border: none;
outline: none;
padding: 10px;
font-size: 18px;
}
.calculator span {
display: grid;
width: 60px;
height: 60px;
color: #fff;
background: #0c2835;
place-items: center;
border: 1px solid rgba(0, 0, 0, .1);
}
.calculator span:active {
background: #74ff3b;
color: #111;
}
.calculator span.clear {
grid-column: span 2;
width: 120px;
background: #ff3077;
}
.calculator span.plus {
grid-row: span 2;
height: 120px;
}
.calculator span.equal {
background: #03b1ff;
}
CSS+Html 简易的计算器
最新推荐文章于 2024-07-19 18:57:55 发布