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

221
Vistas
My span width expands to right but I want it to expand left and auto fit my content inside the span tag

Please click the image https://i.stack.imgur.com/HtSK6.jpg so that you understand I have marked the problem in red I want that time to automatically adjust width for example if the time is 1:25:34 then it expands to left and fill the content without overflowing. I hope you understood my css code which I have written is given below:

<span className="time">{props.time}</span> 
time{
    background-color: black;
    color: white;
    position: absolute;
    top: 8.4rem;
    left: 15.9rem;;
    font-weight: bold;
    height: fit-content;
    font-size: 0.9rem;
   
    width: fit-content;
    
}
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Your question isn't too clear, but looking at your code it seems like you using a internal Css but it isn't in a style container Make sure all CSS codes are placed into style then into head

about 4 years ago · Juan Pablo Isaza Denunciar

0

Since you want your container to be flexible, so as to fit into the box when it shows both the hours, minute and second, then you just add padding. This will create a gap between the text area and the borders.

Make sure to ignore width too as width is flexible

Hope this helps 👍

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