Skip to content

Commit

Permalink
age calculator
Browse files Browse the repository at this point in the history
  • Loading branch information
solangeihirwe03 committed Mar 13, 2024
1 parent 14ba68d commit c59fbf6
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 0 deletions.
45 changes: 45 additions & 0 deletions age.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
*{
padding: 0;
margin: 0;
box-sizing: border-box;
}

body{
width: 30%;
background-color: #252D33;
position: absolute;
left: 35%;
top: 35%;

}
.container{
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background-color: #4D8CB8;
gap: 20px;
}
.dob{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 20px;
}
.dob input{
width: 100%;
padding: 8px;
font-size: 20px;
color: #252D33;
}
.dob button{
padding: 8px;
width: 50%;
color: white;
font-weight: bold;
background: #252D33;
font-size: 15px;
border-radius: 8px;
}
1 change: 1 addition & 0 deletions age.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const date = document.getElementById('date');
22 changes: 22 additions & 0 deletions ageCalculator.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./age.css">
</head>
<body>
<div class="container">
<div class="heading">
<h2>Age Calculator</h2>
</div>
<div class="dob">
<h2>Enter your date of birth</h2>
<input type="date" name="date" id="date">
<button>Calculate Age</button>
</div>
<div class="display"></div>
</div>
</body>
</html>

0 comments on commit c59fbf6

Please sign in to comment.