When implementing a countdown on my website, I encountered a formatting issue when accessing it from a mobile device. The countdown is displayed on two lines instead of one, making it look strange and difficult to resize.
The current code I am using:
body{
text-align: left;
background: #ffffff;
font-family: sans-serif;
font-weight: 100;
}
h1.customclass{
color: #032g71;
font-weight: 50;
font-size: 40px;
margin: 0px 0px 10px;
}
#clockdiv{
font-family: sans-serif;
color: #fff;
display: inline-block;
font-weight: 100;
text-align: center;
font-size: 30px;
}
#clockdiv > div{
padding: 10px;
border-radius: 3px;
background: #055678;
display: inline-block;
}
#clockdiv div > span{
padding: 0px;
border-radius: 3px;
background: #055678;
display: inline-block;
}
.smalltext{
padding-top: 5px;
font-size: 16px;
}
<h1 class="customclass">TEST COUNTDOWN</h1>
<div id="clockdiv">
<div>
<span class="days"></span>
<div class="smalltext">Days</div>
</div>
<div>
<span class="hours"></span>
<div class="smalltext">Hours</div>
</div>
<div>
<span class="minutes"></span>
<div class="smalltext">Minutes</div>
</div>
<div>
<span class="seconds"></span>
<div class="smalltext">Seconds</div>
</div>
</div>
In order to address this issue, I'm considering using:
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
However, I'm unsure how to specifically apply this to the #clockdiv element when accessed from a mobile device. Is there a way to target and resize #clockdiv only for mobile users?
Any assistance with this matter would be greatly appreciated!