Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

361
Vistas
Font-weight in innerHTML text on Laravel only works if it's set to white color

I implemented a countdown in my Laravel 5 application and I wish to change the font weight of its text. For some reason this simple task is taking me a lot of time to figure out. If the color is set to #fff the font-weight is correctly applied. If I change the color, the fon't weight stops working.

Images for comparison: enter image description here enter image description here

blade.php file

<a style="color: #fff" href="">
  <div id="countdown-component" style="display:inline;color:#EC1B33;font-weight:600;letter-spacing:2px;">
  </div>
</a>

JS function to generate the countdown:

<script>
      // Set the date we're counting down to
      var countDownDate = new Date("Feb 15, 2022 12:00:00").getTime();
    
      // Update the count down every 1 second
      var x = setInterval(function() {
    
      // Get today's date and time
      var now = new Date().getTime();
    
      // Find the distance between now and the count down date
      var distance = countDownDate - now;
    
      // Time calculations for days, hours, minutes and seconds
      var days = Math.floor(distance / (1000 * 60 * 60 * 24));
      var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
      var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
      var seconds = Math.floor((distance % (1000 * 60)) / 1000);
    
      // Display the result in the element with id="demo"
      document.getElementById("countdown-component").innerHTML = days + " DAYS " + hours + " HOURS "
      + minutes + " MINUTES " + seconds + " SECONDS ";
    
      // If the count down is finished, write some text
      if (distance < 0) {
        clearInterval(x);
        document.getElementById("countdown-component").innerHTML = "EXPIRED";
      }
    }, 1000);
</script>

Thanks in advance.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

    // Set the date we're counting down to
          var countDownDate = new Date("Feb 15, 2022 12:00:00").getTime();

          // Update the count down every 1 second
          var x = setInterval(function () {
            // Get today's date and time
            var now = new Date().getTime();

            // Find the distance between now and the count down date
            var distance = countDownDate - now;

            // Time calculations for days, hours, minutes and seconds
            var days = Math.floor(distance / (1000 * 60 * 60 * 24));
            var hours = Math.floor(
              (distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)
            );
            var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
            var seconds = Math.floor((distance % (1000 * 60)) / 1000);

            // Display the result in the element with id="demo"
            document.getElementById("countdown-component").innerHTML =
              days +
              " DAYS " +
              hours +
              " HOURS " +
              minutes +
              " MINUTES " +
              seconds +
              " SECONDS ";

            // If the count down is finished, write some text
            if (distance < 0) {
              clearInterval(x);
              document.getElementById("countdown-component").innerHTML = "EXPIRED";
            }
          }, 1000);
    <a style="color: #fff" href="">
          <div
            id="countdown-component"
            style="
              display: inline;
              color: #fff;
              font-weight: 400;
              letter-spacing: 2px;
            "
          ></div>
        </a>
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda