Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
How do I decrease the font size of specific elements in a date displayer

I am creating a website in html. What I want to do decrease the size of the hour, minute and second counter, but keep the size of the day, month and year counters. Splitting the 2 into separate id's doesn't seem to work and only shows the day, month and year. Here's my code:

<html>
<head><title>My website</title>
<style type=text/css>
.clock {background-color: 000000; text-align: center; margin: 2px 0px 0px 1190px; font-size: 30px; position: fixed; border-radius: 10px;   color: #fff; text-shadow: 0 0 4px #fff, 0 0 4px #fff, 0 0 4px #fff; border: 5px solid white;}
div {margin: 2px;}
body {background-color: 0d0d0d; font-family: "Vibur", sans-serif;}
</style>
</head>
<body>
  <p id="date" class="clock"></p>
  <script>
  setInterval(function(){
  date = new Date();
  sekundy = date.getSeconds();
  if (sekundy<10) sekundy = "0"+sekundy;
   minuty = date.getMinutes();
  if (minuty<10) minuty = "0"+minuty;
   godziny = date.getHours()
  if (godziny<10) godziny = "0"+godziny;
   dzien = date.getDay();
   data = date.getDate();
   miesiac = date.getMonth();
   rok = date.getFullYear();
  document.getElementById('date').innerHTML = data+"."+((miesiac+1)%12)+"."+rok+"<br>"+godziny+" : "+minuty+" : "+sekundy;
  },1000);
  </script>
</body>
</html>
I would gladly appreciate any help with figuring it out.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!