<html>
<head>
<link rel="stylesheet" href="index.css">
</head>
<body>
<h1>Christmas Countdown 🎄</h1>
<div class="container">
<p id="countdown-display" class="countdown-display">-</p>
<p class="countdown-text">Days 'til Christmas!</p>
<div class="hms">
<div class="hours">
<p>Hours</p>
<p id="Hoursecountdown-display" class="countdown-display">-</p>
</div>
<div class="mins">
<p>Mins</p>
<p id="Mincountdown-display" class="countdown-display">-</p>
</div>
<div class="secs">
<p>Secs</p>
<p id="countdown-display" class="countdown-display">-</p>
</div>
</div>
</div>
<script src="index.js"></script>
</body>
</html>
css
:root {
--wine-red: #C7375F;
--bright-red: #D42D2F;
--dark-green: #344D2F;
--light-green: #77A047;
--gold: #FAC57D;
--snow: #F0F4F7;
}
html, body {
margin: 0;
padding: 0;
}
body {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
text-align: center;
color: var(--dark-green);
background-color: var(--snow);
}
.container {
display: flex;
flex-direction: column;
background: var(--wine-red);
color: var(--snow);
padding: 1em 2em;
border-radius: 5px;
box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 6px -1px, rgba(0, 0, 0, 0.06) 0px 2px 4px -1px;
width:200px
}
.countdown-display {
font-size: 100px;
margin: 0;
}
.hms{
display: flex;
align-items: center;
justify-content: space-between;
width: 200px;
margin: 0 auto;
}
.hours{
display:flex;
align-items: center;
}
.mins{
display:flex;
align-items: center;
text-align: center;
}
.secs{
display:flex;
align-items: center;
}
Could you see if adding this gets what you want? Since you already have a flex container for the .hms
class, you might just need to adjust the CSS for the .hours
, .mins
and .secs
classes.
.hours p,
.mins p,
.secs p {
margin: 0;
padding-right: 5px; /* I think this can create the spacing between the label and the countdown */
}