Estoy creando un sitio web en html. Lo que quiero hacer es disminuir el tamaño de los contadores de horas, minutos y segundos, pero mantener el tamaño de los contadores de día, mes y año. Dividir los 2 en identificaciones separadas no parece funcionar y solo muestra el día, el mes y el año. Aquí está mi código:
<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>