Calculator Design with html + CSS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="Style.css">
<title>Calculator Project</title>
<style>
*{
padding: 0px;
margin: 0px;
}
h1{
text-align: center;
}
.card{
max-width: 350px;
margin: 0 auto;
text-align: center;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
transition: .3s;
margin-top: 10px;
font-size: 0px; /* for font auto padding off*/
padding: 5px
}
.card:hover{
box-shadow: 0 16px 32px 0 rgba(0, 0, 0, 0.5);
}
.calc-head #result{
width: 335px;
height: 100px;
font-size: 50px;
text-align: right;
padding: 0 5px;
letter-spacing:3px;
}
.calc-body{
}
.btn{
font-size: 30px;
font-weight: bold;
width: 87px;
height: 80px;
background-color: #1f2326;
color: white;
border: 1px solid white;
}
.btn-style{
background-color: rgb(72, 16, 185);
}
.btn:hover{
background-color: black;
}
.btn-style:hover{
background-color: rgb(47, 11, 119);
}
.btn-style-equl{
background-color: rgb(236, 171, 31);
}
.btn-style-equl:hover{
background-color: rgb(194, 134, 5);
}
</style>
</head>
<body>
<h1>Calculator</h1>
<div class="card">
<div class="calc-head">
<input type="text" id="result" maxlength="10">
</div>
<div class="calc-body">
<div>
<input type="button" class="btn" value="C">
<input type="button" class="btn" value="+/-">
<input type="button" class="btn" value="%">
<input type="button" class="btn btn-style" value="/">
</div>
<div>
<input type="button" class="btn" value="7">
<input type="button" class="btn" value="8">
<input type="button" class="btn" value="9">
<input type="button" class="btn btn-style" value="*">
</div>
<div>
<input type="button" class="btn" value="4">
<input type="button" class="btn" value="5">
<input type="button" class="btn" value="6">
<input type="button" class="btn btn-style" value=".">
</div>
<div>
<input type="button" class="btn" value="1">
<input type="button" class="btn" value="2">
<input type="button" class="btn" value="3">
<input type="button" class="btn btn-style" value="+">
</div>
<div>
<input type="button" class="btn" value="0">
<input type="button" class="btn" value=".">
<input type="button" class="btn" value="DEL">
<input type="button" class="btn btn-style-equl" value="=">
</div>
</div>
</div>
</body>
</html>
Answer